[SR-Users] Using PSTN as "fallback"

Daniel-Constantin Mierla miconda at gmail.com
Wed Sep 9 09:32:13 CEST 2015



On 01/09/15 10:00, Michael Nielsen wrote:
> I've added this to my kamailio.cfg (the original which comes with the
> Debian package of Kamailio 4.2):
>
> -----
>
>         # dispatch destinations to PSTN if not a subscriber
>
>         if (!is_subscriber("$ru", "subscriber", "3")) {
>
>                 route(PSTN);
>
>         }
>
>
>         # user location service
>
>         route(LOCATION);
>
> -----
>
>
> Is it correctly understood that it first checks if the subscriber is
> local, if not, it routes to PSTN otherwise it routes locally?
>
>
> Or does it do both local and PSTN route if the subscriber is local?
>
If you have the route[PSTN] from default config file, then inside it
there are some checks to see if the dialed number is in international
format. You may need to adjust those conditions to fit better your needs.

If the conditions in route[PSTN] are not met, then in some case it
returns, meaning that (based on youre xample snippet above),
route[LOCATION] is executed as well. Overall should be harmless, as
there should be no active record in location table, but if you have
other services like voicemail enabled, it is better to send not found if
not local subscriber and route[PSTN] returns back.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - http://asipto.com/u/kat




More information about the sr-users mailing list