[Kamailio-Users] dialplan and carrierroute
Henning Westerholt
henning.westerholt at 1und1.de
Wed Jan 7 15:59:10 CET 2009
On Wednesday 07 January 2009, victorpy wrote:
> i want to know if there is a way of routing based on patern matching using
> caller-id.
> Basically, i want to route through a carrier if the call-id have some
> pattern
>
> Eg.:
>
> international is 002-(country code)-(area code)-697699.
> Long distance is (country code) -(area code) -123456
> Local is 123456
>
> The international and long distance change
>
> If international then route through carrier1
> else if long distance the route through carrier 2
> else if local then route through carrier 3
Hi victorpy,
do we talk about the SIP call-id header field here? Each call should get a
unique one, so i don't think this is feasible. But hashing over the call-id
is possible.
If you mean another header field, then you could just lookup the target of the
call by some other means (e.g. from a DB table, set it from the script), and
give the carrier id to the cr_route function with an AVP. The specific GWs
could then lookup by the cr prefix matching function for each carrier. You
can modify the string that is used for prefix matching as well, as is also
just a pseudo-variable.
Another option would be to just use the 'default' carrier in cr, and use the
normal prefix matching via the R-URI to route the call to the specific GWs.
But you'll loose some flexibility here, as you don't have the possibility to
seperate your routing by several carriers anymore.
Cheers,
Henning
More information about the sr-users
mailing list