Trying to configure extra fields in cdrs:

65 views
Skip to first unread message

వెంకటేష్ ఎన్నల

unread,
Jan 18, 2019, 4:27:01 AM1/18/19
to CGRateS
Hi,

I want to store some custom fields in the cdr which I am feeding, so I am trying to configure like this.

"cdrs": {
        "enabled": true,
        "extra_fields": [ {"BillCode":"billCode"} ],
        "attributes_conns": [ {"address": "127.0.0.1:2012","transport": "*json"}],
},

But the service is not able start saying parsing error. How can I configure this ?
I am using latest mater btw.

Thanks.

వెంకటేష్ ఎన్నల

unread,
Jan 18, 2019, 4:31:10 AM1/18/19
to CGRateS

Also can I use attributes to work on these fields to modify them based on certain criteria ?
If attributes does not work on these fields ... its there a way I can save some custom field which can be processed by attributes and can be saved in cdr ?

Thanks.

Alexandru Tripon

unread,
Jan 18, 2019, 11:28:34 AM1/18/19
to cgr...@googlegroups.com
Hello Venkat,

The extra_fields from cdrs is only used for freeswitch and it is a slice of strings not objects.
The ExtraFields are dependent of your cdrs source

Thanks,
Trial97


--
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/4df65351-71d1-4684-a4ef-16fb8fe39b5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

వెంకటేష్ ఎన్నల

unread,
Jan 18, 2019, 1:27:51 PM1/18/19
to CGRateS
Thanks Trail.

Sorry its not making sense to me to allow this good and important feature only to free switch.

Its listed a a configuration parameter in the docs here. So I though this is not tied or dependent on specific pbx.

Shall I raise a feature request to get this available in general to cdrs ?
Also why would cgrates through a parse exception .. is this a bug ? Also probably documentation need to be changed ?


Thanks,
Venkat.

Alexandru Tripon

unread,
Jan 21, 2019, 5:51:40 AM1/21/19
to cgr...@googlegroups.com
Hello Venkat,

The CGRateS  threw a parse exception only because we expect that extra_fields fields is a list of strings not a list of objects.
For a better understanding of what are you trying to do please specify what you use with CGRateS (freeswitch, kamailio, diameter, radius or httpagent).

Thanks,
Trial97

వెంకటేష్ ఎన్నల

unread,
Jan 21, 2019, 1:29:20 PM1/21/19
to CGRateS
Thanks for pointing it out. I saw some examples in the forum and though it was a json for some reason. The service started properly now.

We are using httpagent.
I added a new extra field to the cdrs ..and its not saving the extra field, so I assume it still only works with free switch ?


Thanks,
Venkat.

Alexandru Tripon

unread,
Jan 22, 2019, 5:01:51 AM1/22/19
to cgr...@googlegroups.com
Hello Venkat,

Here you have a sample for how we configure httpagent:
In your case you need to add a new field in request_fields, where you have the request_procesor with *cdrs flag like this:
{"tag": "ExtraFieldTag", "field_id": "ExtraFieldName", "type": "*constant", "value": "ExtraFieldValue"},
After you adding this you will see in your CDR, in extra_fields something like this:
{"ExtraFieldName":"ExtraFieldValue"} 

Thanks,
Trial97

వెంకటేష్ ఎన్నల

unread,
Jan 23, 2019, 12:48:58 PM1/23/19
to CGRateS
Thanks.
Reply all
Reply to author
Forward
0 new messages