Force carrier or route

90 views
Skip to first unread message

Vivian Alan

unread,
Nov 18, 2021, 1:51:01 PM11/18/21
to CGRateS
Hello,

I've been testing out various aspects of CGRates with the hope to migrate from existing OpenSIPs setup.
In my existing setup, I can route a specific prefix to a specific carrier/gateway using the drouting function in OpenSIPs.
In CGRates, I notice that it uses Routes and Filters, to choose the carrier.
Is there any way to force CGRates to use a specific carrier from within OpenSIPs (like setting a parameter when calling CGRates)?

Thank you

Vivian

Adrian Porosnicu

unread,
Nov 29, 2021, 7:23:13 AM11/29/21
to CGRateS

Hello Vivian!

Yes,  cgrates has a way to use a specific carrier(route). In a route profile, you can set the sorting strategy on "*weight", and on every route you can set the "Weight" field based on your expectations. After that, the routes will be sorted based on weight, so this will use a specific route. Here is an example of data:


Here is a test based on this route:


Thanks,
Adrian

Vivian Alan

unread,
Nov 29, 2021, 8:28:04 AM11/29/21
to CGRateS

Hi Adrian,

Thank you for looking into this.
I found that I could use RouteID with FilterIDs to determine which route I would allow a specific customer to take.
Routes.csv
cgrates.org,ROUTE_ACNT_R,,,,,A1RET,FLT_PRE_9008,,,,Stats2,10,,,
cgrates.org,ROUTE_ACNT_R,,,,,B1RET,FLT_PRE_9001,,,,Stats2,20,,,
Filters.csv
cgrates.org,FLT_PRE_9008,*string,~*req.CarrierPrefix,9008,2014-07-29T15:00:00Z
cgrates.org,FLT_PRE_9001,*string,~*req.CarrierPrefix,9001,2014-07-29T15:00:00Z

OpenSIPs:
$cgr(CarrierPrefix) = $avp(CarrierPrefix);

In OpenSIPs I send the CarrierPrefix received from the client to then allow the call to take the specific route.
So if the CarrierPrefix from client was 9008 it would take A1RET.


Let me know your thoughts.

Thank you

Vivian

Adrian Porosnicu

unread,
Nov 29, 2021, 9:54:24 AM11/29/21
to CGRateS
Hi Vivian,

That's also correct, this should work also with FIlterIDs.

Thanks,
Adrian.

Reply all
Reply to author
Forward
0 new messages