<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p>which log message you see in the syslog?</p>
<p>***********ROUTE PSTN***********</p>
<p>or:</p>
<p>PSTN ACTIVADO</p>
<p>or none of them?</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div class="moz-cite-prefix">On 03.07.20 21:21, sip user wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CALwUm-iGDHhpH=8Xe52eF3zniUkPiKVg+TVVEc1gvSogPWMz5w@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi, I have kamailio connect to Teams, and works form
Asterisk -> Teams calls.</div>
<div>For Teams -> Asterisk calls I'd worked using extension
and register Asterisk with that extension.</div>
<div><br>
</div>
<div>But I'd like to use direct routing with IP.</div>
<div><br>
</div>
<div>In kamailio.cfg I activate define WITH_PSTN.</div>
<div>I configured the IP and PORT for my PSTN.</div>
<div><br>
</div>
<div>I'm using the default route[PSTN]:</div>
<div><br>
</div>
<div>route[PSTN] {<br>
#!ifdef WITH_PSTN<br>
# check if PSTN GW IP is defined<br>
xlog("L_INFO","PSTN ACTIVADO");<br>
if (strempty($sel(cfg_get.pstn.gw_ip))) {<br>
xlog("SCRIPT: PSTN routing enabled but
pstn.gw_ip not defined\n");<br>
return;<br>
}<br>
<br>
# route to PSTN dialed numbers starting with '+' or
'00'<br>
# (international format)<br>
# - update the condition to match your dialing rules
for PSTN routing<br>
if(!($rU=~"^(\+|00)[1-9][0-9]{3,20}$")){<br>
xlog("L_INFO", "Error en el formato
numerico!!");<br>
return;<br>
}<br>
<br>
# only local users allowed to call</div>
<div> if(from_uri!=myself) {<br>
sl_send_reply("403", "Not Allowed");<br>
exit;<br>
}<br>
<br>
# normalize target number for pstn gateway<br>
# - convert leading 00 to +<br>
#if (starts_with("$rU", "00")) {<br>
# strip(2);<br>
# prefix("+");<br>
#}<br>
<br>
if (strempty($sel(cfg_get.pstn.gw_port))) {<br>
#$ru = "sip:" + $rU + "@" +
$sel(cfg_get.pstn.gw_ip);<br>
xlog("L_INFO","SELECCION CON PUERTO");<br>
$ru = "sip:" + $rU + "@" +
$sel(cfg_get.pstn.gw_ip) + ":"<br>
+
$sel(cfg_get.pstn.gw_port);<br>
} else {<br>
xlog("L_INFO","SELECCION CON PUERTO");<br>
$ru = "sip:" + $rU + "@" +
$sel(cfg_get.pstn.gw_ip) + ":"<br>
+
$sel(cfg_get.pstn.gw_port);<br>
}</div>
<div><br>
route(RELAY);<br>
exit;<br>
#!endif<br>
<br>
return;<br>
}</div>
<div><br>
</div>
<div>And in my request_route:</div>
<div><br>
</div>
<div> remove_hf("Route");<br>
if (is_method("INVITE|SUBSCRIBE")) {<br>
if($src_ip != "IP ASTERISK"){<br>
xlog("L_INFO", "***********ROUTE
PSTN***********");<br>
route(PSTN);<br>
} else {<br>
xlog("L_INFO","LLamada desde $si con
puerto $sp");<br>
record_route_preset("FQND:5061;transport=tls", "IP
KAMAILIO:5060");<br>
add_rr_param(";r2=on");<br>
route(DISPATCH);<br>
route(RELAY);<br>
}<br>
}</div>
<div><br>
</div>
<div>But never see that the call go to PSTN route..</div>
<div><br>
</div>
<div>I'd made any wrong??</div>
<div><br>
</div>
<div>Thanks<br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Funding: <a class="moz-txt-link-freetext" href="https://www.paypal.me/dcmierla">https://www.paypal.me/dcmierla</a></pre>
</body>
</html>