[v0.10] fs_agent - charge both legs of call

81 views
Skip to first unread message

Marcin Kowalczyk

unread,
Feb 13, 2025, 9:58:53 AM2/13/25
to CGRateS
Hi,

 I have a scenario, where call arrives to freeswitch where it's handled on IVR (toll-free number) and there is an option to forward call to external number. 

My first idea was to use derived charging option to rate event twice, but user can stay in IVR way longer than on call with forward targed.  I tried to do following:

account for both legs
                    <action application="export" data="cgr_account=%{tenant}"/>
                    <action application="set" data="cgr_destination=${translate(${destination_number} NO_PLUS)}"/>
                    <action application="set" data="cgr_subject=${translate(${caller_id_number} NO_PLUS)}"/>
                    <action application="set" data="cgr_category=USD*inbound"/>
                    <action application="set" data="cgr_reqtype=*rated"/>


export-nolocal for forwarded leg
                    <action application="export" data="nolocal:cgr_category=USD*call"/>
                    <action application="export" data="nolocal:cgr_reqtype=*postpaid"/>
                    <action application="export" data="nolocal:cgr_account=%{tenant}"/>
                    <action application="export" data="nolocal:cgr_destination=${translate(${forward_destination} NO_PLUS)}"/>
                    <action application="export" data="nolocal:cgr_subject=${translate(${destination_number} NO_PLUS)}"/>


but I get only one leg in cdr's. I've tried to manipulate cgr_originhost to try to get duplcation but no luck
                    <action application="export" data="nolocal:cgr_originhost=${podname}_forward"/>

Is it possible with v0.10 and fs_agent achieve such scenario (to have both A and B legs charged with different call lenght and categories)?

Regards
Marcin 

Dan B

unread,
Feb 17, 2025, 7:26:10 AM2/17/25
to CGRateS
Hi Marcin,

We recommend you using call loop-over for the second leg and always charge A-Leg of the call. 
We have done this in the past by using fs_path=sip:127.0.0.1:5060. In this way you will be able to treat each leg as separate call in CGRateS and also have distinct usage for each.

Hope it helps.

DanB

Salvinder Parhar

unread,
Feb 18, 2025, 5:30:38 PM2/18/25
to CGRateS
Hi Dan,

I came across this same issue a while back and gave up on finding a work-around/solution for this issue. Can you please explain a bit more about what you mean by "call loop-over for the second leg and always charge A-Leg of the call". 
Regarding your suggestion of using fs_path=sip:127.0.0.1:5060, where are you suggesting to put this sting in the dialplan? Sorry, I'm little confused.

Thanks,
Sal

Marcin Kowalczyk

unread,
Feb 19, 2025, 1:04:42 AM2/19/25
to cgr...@googlegroups.com

In principal you need to create another sip-sofia profile that will be used for accounting. So this will double the number of calls on freeswitch.


--
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 view this discussion visit https://groups.google.com/d/msgid/cgrates/0b2652c3-8e12-4e50-91c5-f3f93732cab6n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages