<div dir="ltr">hi Andrew<div>I am new to sipwise and kamailio.<br>My goal is to build a solid platform with sipwise.<br>  I'll follow your advice.<br>  I will use at least 7 digits, I can also use a rewrite rule in input and output to convert to 7 digits and convert back to less than 7 digits.<br>In all these cases, I would like to say thank you.<br><br></div><div>I test it in my lab, it's OK !!!!</div><div><br></div><div>I appreciate  <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 14 avr. 2020 à 16:05, Andrew Pogrebennyk <<a href="mailto:apogrebennyk@sipwise.com">apogrebennyk@sipwise.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Florent,<div>I got it, now it’s clear that the system can not match dialed number with a subscriber, the reason being that subscriber number is too short.</div><div>In the log we see messages "Callee is not local” and “No PSTN gateways available”, so it was a mis-routed attempt, this is due to SQL query in /etc/kamailio/proxy/proxy.cfg which does INSTR with min number length 7 digits. Your subscriber’s numbers are shorter than that.</div><div>The solution is to use base number of at least 7 digits, or as a work-around (non upgrade-safe and only if you are understand kamailio config file syntax) create a customtt file inside /etc/ngcp-config/templates (according to manual) that permits shorter base numbers, the exact line looking something like this, varying from one to another version:</div><div><span style="white-space:pre-wrap">               </span>sql_pvquery("local", "select username,domain,alias_username,is_primary,is_devid,devid_alias from dbaliases where alias_username like concat(left('$(var(callee_user){s.escape.common})', 7), '%') and instr('$(var(callee_user){s.escape.common})', alias_username)=1 order by length(alias_username) desc limit 1", "$avp(s:callee_user);$avp(s:callee_domain);$avp(s:callee_base_user);$avp(s:is_primary);$avp(s:callee_is_devid);$avp(s:callee_devid_alias)");<br><div>Hope this helps.</div><div>Andrew</div><div><br><blockquote type="cite"><div>On 14.04.2020, at 17:29, florent goue <<a href="mailto:florentgoue@gmail.com" target="_blank">florentgoue@gmail.com</a>> wrote:</div><br><div><div dir="auto">Hi Andrew <div dir="auto">Did you read my last mail.</div><div dir="auto">Thx</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 13 avr. 2020 à 19:59, florent goue <<a href="mailto:florentgoue@gmail.com" target="_blank">florentgoue@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><font size="4">hi Andrew</font><div><font size="4">thanks for your mail.</font></div><div><font size="4"><br></font></div><div><font size="4">information about your setup :</font></div><div><font size="4"> Sipwise CE 8.3.3 </font></div><div><font size="4"> I had this problem with 7.5.3 CE<br></font></div><div><font size="4"> In my lab, I setup:</font></div><div><font size="4">  2 domain</font></div><div><font size="4">  3 customers</font></div><div><font size="4">  9 subscribers ( numbers: <span style="background-color:rgb(240,243,247);color:rgb(51,51,51);font-family:"Open Sans",arial,sans-serif">200280, </span><span style="background-color:rgb(245,245,245);color:rgb(51,51,51);font-family:"Open Sans",arial,sans-serif">20012, </span><span style="background-color:rgb(240,243,247);color:rgb(51,51,51);font-family:"Open Sans",arial,sans-serif">200150, </span><span style="background-color:rgb(245,245,245);color:rgb(51,51,51);font-family:"Open Sans",arial,sans-serif">200330, </span><span style="background-color:rgb(240,243,247);color:rgb(51,51,51);font-family:"Open Sans",arial,sans-serif">200338, </span><span style="background-color:rgb(245,245,245);color:rgb(51,51,51);font-family:"Open Sans",arial,sans-serif">200320, </span><span style="background-color:rgb(240,243,247);color:rgb(51,51,51);font-family:"Open Sans",arial,sans-serif">200340)</span></font></div><div><font size="4"><span style="background-color:rgb(240,243,247);color:rgb(51,51,51);font-family:"Open Sans",arial,sans-serif">   </span><span style="background-color:rgb(240,243,247);color:rgb(51,51,51);font-family:"Open Sans",arial,sans-serif"> In my test:</span></font></div><div><font size="4"><span style="background-color:rgb(240,243,247);color:rgb(51,51,51);font-family:"Open Sans",arial,sans-serif">  </span><span style="background-color:rgb(240,243,247);color:rgb(51,51,51);font-family:"Open Sans",arial,sans-serif">A subscriber call the </span>200120 number, the call fail  (We would have liked the call to reach the number 20012)</font></div><div><font size="4"> <span style="background-color:rgb(240,243,247);color:rgb(51,51,51);font-family:"Open Sans",arial,sans-serif"> </span><span style="background-color:rgb(240,243,247);color:rgb(51,51,51);font-family:"Open Sans",arial,sans-serif">A subscriber call the </span>2001500 number, the call fail (We would have liked the call to reach the number 200150)</font></div><div><span style="background-color:rgb(240,243,247);color:rgb(51,51,51);font-family:"Open Sans",arial,sans-serif"><font size="4"> The </font></span></div><div><font size="4"><span style="color:rgb(51,51,51);font-family:"Open Sans",arial,sans-serif;background-color:rgb(240,243,247)"><br>extended_dialing_mode</span> : Extension matching, send dialed number with extension<br><br>Log1:</font></div></div></blockquote></div></div></blockquote></div></div></div></blockquote></div>