[SR-Users] call routing using kamailio 3.0.2
Meftah Tayeb
tayeb.meftah at gmail.com
Thu Jun 3 00:42:55 CEST 2010
thank you
Le 31/05/2010 10:34, Klaus Darilion a écrit :
> Am 31.05.2010 13:57, schrieb Meftah Tayeb:
> > hello,
> > how do i route calls from local registered users to a pstn gateway?
>
> 1. analyze the RURI to find out if the called user is a phone number,
> e.g.:
>
> if ($rU ~= "\+1[1-9]*") {
> route(11); # PSTN
> } else {
> route(12); # local user
> }
> exit;
>
> 2. route to gateway
>
> route[11] {
> # if needed apply number reformating if the dialing plan
> # of the SIP proxy is different then the dialing plan of the
> # gateway. we change the userpart of the request URI (RURI)
> strip(1);
> prefix("00");
>
> # send to gateway. for example by changing the host-part
> # of RURI
> $rd = "1.2.3.4"; # IP address of the gateway
>
> # forward to gateway and exit;
> t_relay();
> exit;
> }
>
>
>
> regards
> Klaus
More information about the sr-users
mailing list