[SR-Users] Route to PSTN no works

Daniel-Constantin Mierla miconda at gmail.com
Tue Jul 7 08:20:44 CEST 2020


Hello,

which log message you see in the syslog?

***********ROUTE PSTN***********

or:

PSTN ACTIVADO

or none of them?

Cheers,
Daniel

On 03.07.20 21:21, sip user wrote:
> Hi, I have kamailio connect to Teams, and works form Asterisk -> Teams
> calls.
> For Teams -> Asterisk calls I'd worked using extension and register
> Asterisk with that extension.
>
> But I'd like to use direct routing with IP.
>
> In kamailio.cfg I activate define WITH_PSTN.
> I configured the IP and PORT for my PSTN.
>
> I'm using the default route[PSTN]:
>
> route[PSTN] {
> #!ifdef WITH_PSTN
>         # check if PSTN GW IP is defined
>         xlog("L_INFO","PSTN ACTIVADO");
>         if (strempty($sel(cfg_get.pstn.gw_ip))) {
>                 xlog("SCRIPT: PSTN routing enabled but pstn.gw_ip not
> defined\n");
>                 return;
>         }
>
>         # route to PSTN dialed numbers starting with '+' or '00'
>         #     (international format)
>         # - update the condition to match your dialing rules for PSTN
> routing
>         if(!($rU=~"^(\+|00)[1-9][0-9]{3,20}$")){
>                 xlog("L_INFO", "Error en el formato numerico!!");
>                 return;
>         }
>
>         # only local users allowed to call
>         if(from_uri!=myself) {
>                 sl_send_reply("403", "Not Allowed");
>                 exit;
>         }
>
>         # normalize target number for pstn gateway
>         # - convert leading 00 to +
>         #if (starts_with("$rU", "00")) {
>         #       strip(2);
>         #       prefix("+");
>         #}
>
>         if (strempty($sel(cfg_get.pstn.gw_port))) {
>                 #$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);
>                 xlog("L_INFO","SELECCION CON PUERTO");
>                 $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip) + ":"
>                                         + $sel(cfg_get.pstn.gw_port);
>         } else {
>                 xlog("L_INFO","SELECCION CON PUERTO");
>                 $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip) + ":"
>                                         + $sel(cfg_get.pstn.gw_port);
>         }
>
>         route(RELAY);
>         exit;
> #!endif
>
>         return;
> }
>
> And in my request_route:
>
>  remove_hf("Route");
>         if (is_method("INVITE|SUBSCRIBE")) {
>                 if($src_ip != "IP ASTERISK"){
>                         xlog("L_INFO", "***********ROUTE
> PSTN***********");
>                         route(PSTN);
>                 } else {
>                         xlog("L_INFO","LLamada desde $si con puerto $sp");
>                         record_route_preset("FQND:5061;transport=tls",
> "IP KAMAILIO:5060");
>                         add_rr_param(";r2=on");
>                         route(DISPATCH);
>                         route(RELAY);
>                 }
>         }
>
> But never see that the call go to PSTN route..
>
> I'd made any wrong??
>
> Thanks
>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200707/f4a30b47/attachment.html>


More information about the sr-users mailing list