Hi Guys, I'm new on Kamailio and this list, so be patient with me :)
I've built an almost "complete" working SIP server on Ubuntu 14.04 LTS. I told almost complete because my problem is with carrierroute module because I'm not understanding the routing file and where I should put the code to use function cr_route
I would like to allow SIP calls/video between users for free and send calls to different external Gateways / Switches, etc based on the dialled destination.
In particular, I can send outbound calls a prepaid platform that will allow to bill calls based on CLI validation, but in all my tests, it seems that calls are going out always to the IP address of the remote gateway found into the carrierroute table ignoring the SIP user I'm calling.....what is the correct routing?
I'm finding some docs around there, but some refer to very old versions of Kamailio and some others are not clear to me.
What's wrong with my routing logic?
Thank you so much! Max
route {
# per request initial checks route(REQINIT);
# NAT detection route(NAT);
# handle requests within SIP dialogs route(WITHINDLG);
### only initial requests (no To tag)
# CANCEL processing if (is_method("CANCEL")) { if (t_check_trans()) t_relay(); exit; }
t_check_trans();
# authentication route(AUTH);
# record routing for dialog forming requests (in case they are routed) # - remove preloaded route headers remove_hf("Route"); if (is_method("INVITE|SUBSCRIBE")) record_route();
# account only INVITEs if (is_method("INVITE")) { setflag(FLT_ACC); # do accounting } # dispatch requests to foreign domains route(SIPOUT);
### requests for my local domains
# handle presence related requests route(PRESENCE);
# handle registrations route(REGISTRAR);
if ($rU==$null) { # request with no Username in RURI sl_send_reply("484","Address Incomplete"); exit; }
# dispatch destinations to PSTN #route(PSTN); # CARRIERROUTE MODULE routing logic # check table for carrier default and domain default if(!cr_route("default", "default", "$rU", "$rU", "call_id")){ sl_send_reply("403", "Not allowed"); } else { # In case of failure, re-route the request t_on_failure("1"); # Relay the request to the gateway t_relay(); }
# user location service route(LOCATION);
route(RELAY); }
Hi, is there someone could give me a hint on how to configure this module? I can see that the call is going out to my external gateway interrogating the routing table, however I'm getting a CANCEL from Kamailio.
If using this cr_route I can see that users can't place calls themself (internal calls) because all calls are going out to the external IP. In my opinion the cr_route should be placed replacing PSTN route, right? However I'm still getting the problem.
Thanks Max
Inizio messaggio inoltrato:
Da: "Massimo Varriale (IPZeta)" m.varriale@ipzeta.it Oggetto: [Kamailio 4.2.0] Carrieroute Routing Questions Data: 25 novembre 2014 16:27:05 GMT+01:00 A: sr-users@lists.sip-router.org
Hi Guys, I'm new on Kamailio and this list, so be patient with me :)
I've built an almost "complete" working SIP server on Ubuntu 14.04 LTS. I told almost complete because my problem is with carrierroute module because I'm not understanding the routing file and where I should put the code to use function cr_route
I would like to allow SIP calls/video between users for free and send calls to different external Gateways / Switches, etc based on the dialled destination.
In particular, I can send outbound calls a prepaid platform that will allow to bill calls based on CLI validation, but in all my tests, it seems that calls are going out always to the IP address of the remote gateway found into the carrierroute table ignoring the SIP user I'm calling.....what is the correct routing?
I'm finding some docs around there, but some refer to very old versions of Kamailio and some others are not clear to me.
What's wrong with my routing logic?
Thank you so much! Max
route {
# per request initial checks route(REQINIT);
# NAT detection route(NAT);
# handle requests within SIP dialogs route(WITHINDLG);
### only initial requests (no To tag)
# CANCEL processing if (is_method("CANCEL")) { if (t_check_trans()) t_relay(); exit; }
t_check_trans();
# authentication route(AUTH);
# record routing for dialog forming requests (in case they are routed) # - remove preloaded route headers remove_hf("Route"); if (is_method("INVITE|SUBSCRIBE")) record_route();
# account only INVITEs if (is_method("INVITE")) { setflag(FLT_ACC); # do accounting } # dispatch requests to foreign domains route(SIPOUT);
### requests for my local domains
# handle presence related requests route(PRESENCE);
# handle registrations route(REGISTRAR);
if ($rU==$null) { # request with no Username in RURI sl_send_reply("484","Address Incomplete"); exit; }
# dispatch destinations to PSTN #route(PSTN);
# CARRIERROUTE MODULE routing logic # check table for carrier default and domain default if(!cr_route("default", "default", "$rU", "$rU", "call_id")){ sl_send_reply("403", "Not allowed"); } else { # In case of failure, re-route the request t_on_failure("1"); # Relay the request to the gateway t_relay(); }
# user location service route(LOCATION);
route(RELAY); }
No one can help me? A hint or a documentation to read, please!
Thank you Max
Il giorno 27/nov/2014, alle ore 13:19, Massimo Varriale (IPZeta) ha scritto:
Hi, is there someone could give me a hint on how to configure this module? I can see that the call is going out to my external gateway interrogating the routing table, however I'm getting a CANCEL from Kamailio.
If using this cr_route I can see that users can't place calls themself (internal calls) because all calls are going out to the external IP. In my opinion the cr_route should be placed replacing PSTN route, right? However I'm still getting the problem.
Thanks Max
Inizio messaggio inoltrato:
Da: "Massimo Varriale (IPZeta)" m.varriale@ipzeta.it Oggetto: [Kamailio 4.2.0] Carrieroute Routing Questions Data: 25 novembre 2014 16:27:05 GMT+01:00 A: sr-users@lists.sip-router.org
Hi Guys, I'm new on Kamailio and this list, so be patient with me :)
I've built an almost "complete" working SIP server on Ubuntu 14.04 LTS. I told almost complete because my problem is with carrierroute module because I'm not understanding the routing file and where I should put the code to use function cr_route
I would like to allow SIP calls/video between users for free and send calls to different external Gateways / Switches, etc based on the dialled destination.
In particular, I can send outbound calls a prepaid platform that will allow to bill calls based on CLI validation, but in all my tests, it seems that calls are going out always to the IP address of the remote gateway found into the carrierroute table ignoring the SIP user I'm calling.....what is the correct routing?
I'm finding some docs around there, but some refer to very old versions of Kamailio and some others are not clear to me.
What's wrong with my routing logic?
Thank you so much! Max
route {
# per request initial checks route(REQINIT);
# NAT detection route(NAT);
# handle requests within SIP dialogs route(WITHINDLG);
### only initial requests (no To tag)
# CANCEL processing if (is_method("CANCEL")) { if (t_check_trans()) t_relay(); exit; }
t_check_trans();
# authentication route(AUTH);
# record routing for dialog forming requests (in case they are routed) # - remove preloaded route headers remove_hf("Route"); if (is_method("INVITE|SUBSCRIBE")) record_route();
# account only INVITEs if (is_method("INVITE")) { setflag(FLT_ACC); # do accounting } # dispatch requests to foreign domains route(SIPOUT);
### requests for my local domains
# handle presence related requests route(PRESENCE);
# handle registrations route(REGISTRAR);
if ($rU==$null) { # request with no Username in RURI sl_send_reply("484","Address Incomplete"); exit; }
# dispatch destinations to PSTN #route(PSTN);
# CARRIERROUTE MODULE routing logic # check table for carrier default and domain default if(!cr_route("default", "default", "$rU", "$rU", "call_id")){ sl_send_reply("403", "Not allowed"); } else { # In case of failure, re-route the request t_on_failure("1"); # Relay the request to the gateway t_relay(); }
# user location service route(LOCATION);
route(RELAY); }
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