Request processors reply field with filtering

51 views
Skip to first unread message

Razhan Hameed

unread,
Dec 4, 2018, 8:04:44 AM12/4/18
to CGRateS
Hi guys,
I wanna send new fields in the CCA-U when the last chunk of data is asked by the Diameter client.
How can I do this filtering? I know there "gt" and "lte" but I dont know how to use them. I would appreciate an explanation or a solution...


Regards,

Dan Christian Bogos

unread,
Dec 4, 2018, 11:31:14 AM12/4/18
to cgr...@googlegroups.com
Hi Razhan,

You could test something like: *lte:*cgrep.MaxUsage:10 (I hope it
works without conversion).

DanB
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/cgrates/59da4faf-ea62-40b4-b9be-fa2fd7e102bb%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.

Razhan Hameed

unread,
Dec 5, 2018, 12:31:06 AM12/5/18
to CGRateS
Hey Dan, I actually did, but it didn't work, can you show me a good way to configure it?

Dan Christian Bogos

unread,
Dec 5, 2018, 4:56:59 AM12/5/18
to cgr...@googlegroups.com
Razhan,

I thought I already did ;).

You can also try a filter like:
*lte:*cgrep.MaxUsage:10ns
This will enforce the units to compare against (10) as time.Duration
(internal unit we use for all Usage types).
As a tip to troubleshoot, I recommend adding *log flag to your
templates and playing with the filter to make sure it matches your
expectations.

DanB
> https://groups.google.com/d/msgid/cgrates/6b354538-7bdd-47b1-a24b-4ba40ddbffe2%40googlegroups.com

Razhan Hameed

unread,
Dec 5, 2018, 5:56:22 AM12/5/18
to CGRateS
Dan I am trying it in every possible way it doesn't really work,
I am testing it with the result code field here
{"tag": "ResultCode", "type": "*constant",
    "filters": ["*lte:*cgrep.MaxUsage{*duration_nanoseconds}:3ns"],
    "field_id": "Multiple-Services-Credit-Control.Result-Code",
    "value": "2001"},

Dan Christian Bogos

unread,
Dec 5, 2018, 6:13:27 AM12/5/18
to cgr...@googlegroups.com
Razhan,

Please add log to your template, capture ngrep coming from CGRateS and
diameter reply which you send to Cisco. Pack them (ngrep+syslog+.pcap
of diameter reply) together with your CGRateS configuration and send
them over (you can also send it privately).

DanB

Razhan Hameed

unread,
Dec 5, 2018, 8:22:35 AM12/5/18
to CGRateS
Hey dan I send all the necessary files

Dan Christian Bogos

unread,
Dec 10, 2018, 1:50:54 PM12/10/18
to cgr...@googlegroups.com
Hi Razhan,

Based on your trace the MaxUsage replied is:
'{"id":1,"result":{"Attributes":null,"MaxUsage":2},"error":null}' and
your filter is:
'{"tag": "ResultCode", "type": "*constant", "filters":
["*gt:*cgrep.MaxUsage{*duration_nanoseconds}:3"], "field_id":
"Multiple-Services-Credit-Control.Result-Code","value": "2001"}'

hence your ResultCode will never be added since the filter does not
match.

I don't see any issue with CGRateS in this case.

DanB
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/cgrates/fb7e1ad8-4422-4838-a426-42229078c576%40googlegroups.com

Razhan Hameed

unread,
Dec 11, 2018, 2:02:53 AM12/11/18
to CGRateS
Hi Dan,
I changed it to zero like this
"filters": ["*gt:*cgrep.MaxUsage{*duration_nanoseconds}:0"],
but still this field will not appear in the response and the maxUsage is still 2

Dan Christian Bogos

unread,
Dec 11, 2018, 6:38:48 AM12/11/18
to cgr...@googlegroups.com
Hi Razhan,

Would need again all the information (your final config, ngrep on 2012
- important, since you sent me .pcap, syslog).

Thanks,
DanB
> https://groups.google.com/d/msgid/cgrates/b97c5840-9403-4981-a6f4-db2e2fc4c9e5%40googlegroups.com
Reply all
Reply to author
Forward
0 new messages