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