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?



On Mon, Aug 31, 2015 at 8:57 AM, Michael Nielsen <mic.niel84@gmail.com> wrote:
I'll look at the auth_db, as I'm not routing to any media-relay on simple calls between subscribers.
Only for voicemail and such do I route the calls to my FreeSWITCH.

On Sun, Aug 30, 2015 at 9:50 PM, Alexandru Covalschi <568691@gmail.com> wrote:
Or well, if you don't use any media-relay you just need http://kamailio.org/docs/modules/4.4.x/modules/auth_db.html#idp15567480

2015-08-30 22:41 GMT+03:00 Alexandru Covalschi <568691@gmail.com>:
it depends on which PBX you use for media relay and which codes when no user available does it return.
What I'd suggest is to check if call is coming not from PSTN (if it comes from PSTN - it's for sure must be routed to PBX) and if TRUE, then first send call to PBX and if answer is not 180/183 200 etc. (you can catch that in a specific failure_route) route calls back to PSTN.

2015-08-30 12:04 GMT+03:00 Michael Nielsen <mic.niel84@gmail.com>:
I have Kamailio running and connected to a PSTN gateway.

My subscribers are named ex. +442071234567 - same as their real GSM number from my PSTN gateway.

I'm using the standard kamailio.cfg which ships with version 4.3.

When I'm trying to dial SIP client to SIP client I would like to have Kamailio route the call internally if a subscriber exists with ex. +442071234567.
If no subscriber exists with ex. +442071234567 it should send it to my PSTN gateway.

As it is now it seems as if it are trying to both call "internally" and via the PSTN gateway.

How should one fix this issue the best way?

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




--
Alexandru Covalschi
ABRISS-Solutions
VoIP engineer and system administrator
phone: +37367398493
web: http://abs-telecom.com/



--
Alexandru Covalschi
ABRISS-Solutions
VoIP engineer and system administrator
phone: +37367398493
web: http://abs-telecom.com/

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users