<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
span.HTMLVorformatiertZchn
        {mso-style-name:"HTML Vorformatiert Zchn";
        mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert";
        font-family:Consolas;
        color:black;
        mso-fareast-language:EN-US;}
span.E-MailFormatvorlage23
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.E-MailFormatvorlage24
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.E-MailFormatvorlage25
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.E-MailFormatvorlage26
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.pln
        {mso-style-name:pln;}
span.kwd
        {mso-style-name:kwd;}
span.pun
        {mso-style-name:pun;}
span.str
        {mso-style-name:str;}
span.E-MailFormatvorlage31
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.E-MailFormatvorlage32
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.E-MailFormatvorlage33
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.E-MailFormatvorlage34
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:115874863;
        mso-list-type:hybrid;
        mso-list-template-ids:1469475670 -902900130 201785369 201785371 201785359 201785369 201785371 201785359 201785369 201785371;}
@list l0:level1
        {mso-level-text:"%1\.\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1
        {mso-list-id:705760940;
        mso-list-template-ids:190898590;}
@list l1:level1
        {mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2
        {mso-list-id:2107458571;
        mso-list-type:hybrid;
        mso-list-template-ids:426935194 201785359 201785369 201785371 201785359 201785369 201785371 201785359 201785369 201785371;}
@list l2:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l2:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l2:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE-AT link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Hello,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>yes this works now!<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Hopfully the FINAL Version:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        if(is_method("INVITE") && !($rU =~ "^\+?[0-9]+$") && !has_totag() )<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                xlog("L_WARN", "Dialed number is not numeric - '$rU' - [% logreq -%]\n");<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                sl_send_reply("403", "Dialed number is not numeric");<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                route(ROUTE_EXIT);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        }</span><span style='color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=DE style='color:windowtext;mso-fareast-language:DE-AT'>Von:</span></b><span lang=DE style='color:windowtext;mso-fareast-language:DE-AT'> Daniel Grotti <dgrotti@sipwise.com> <br><b>Gesendet:</b> Dienstag, 21. August 2018 21:46<br><b>An:</b> Hohl Matthias <matthias.hohl@telematica.at><br><b>Cc:</b> spce-user@lists.sipwise.com<br><b>Betreff:</b> Re: AW: AW: AW: [Spce-user] How to deal with non-numeric characters in a dialed number<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>You can use the has_totag() to check if its a re-invite.<span style='font-size:12.0pt;mso-fareast-language:DE-AT'><o:p></o:p></span></p><div><p class=MsoNormal>Initial invites will have has_totag() false.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Cheers<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Daniel<o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div id=AppleMailSignature><p class=MsoNormal>Sent from my iPhone<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><br>On 21.08.2018, at 21:37, Hohl Matthias <<a href="mailto:matthias.hohl@telematica.at">matthias.hohl@telematica.at</a>> wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal><span style='color:#1F497D'>Hello,</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>yes this is accepted as well with this regex.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>But we found another problem if there will be a second invite within a call, if there is for an example a fax behind:</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Aug 21 20:34:31 spce proxy[13116]: NOTICE: <script>: NAT-Reply - S=200 - OK M=INVITE IP=92.63.xxx.xx:5060 (127.0.0.1:5080) ID=af397a3b-2013-1237-7089-002590386650 UA='3CXPhoneSystem 15.5.3849.1 (3849)'</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Aug 21 20:34:31 spce proxy[13116]: NOTICE: <script>: [dialog:start] lua_dlg_callid:[af397a3b-2013-1237-7089-002590386650]  - R=<null> ID=af397a3b-2013-1237-7089-002590386650 UA='3CXPhoneSystem 15.5.3849.1 (3849)'</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Aug 21 20:34:31 spce proxy[13119]: NOTICE: <script>: New request on proxy - M=ACK R=sip:127.0.0.1:5080;prxroute=1 F=sip:4367677777777@92.63.xxx.xx T=sip:80244311111112@92.63.xxx.xx IP=92.63.xxx.xx:5060 (127.0.0.1:5060) ID=af397a3b-2013-1237-7089-002590386650 UA='<null>'</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Aug 21 20:34:31 spce proxy[13120]: NOTICE: <script>: New request on proxy - M=INVITE R=sip:mod_sofia@92.63.xxx.xx:5080 F=sip:43112345@92.63.xxx.xx T=sip:43676777777@sip.telematica.at IP=127.0.0.1:5080 (127.0.0.1:5080) ID=af397a3b-2013-1237-7089-002590386650 UA='3CXPhoneSystem 15.5.3849.1 (3849)'</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>It looks like this happens very often, so I think matching again the $rU is not the best thing, to solve this problem.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I am also wondering why rate-o-mat has no problem with this invite if this is inside a call. But I think maybe cause rate o mat just look onto the initial call.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Anyway: how can I solve this problem?</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Is it possible and wise just to look onto the “TO” Sip Header? And if yes, whats the variable for this? We tried “$tu” but it blocks then all incoming calls.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=DE style='color:windowtext;mso-fareast-language:DE-AT'>Von:</span></b><span lang=DE style='color:windowtext;mso-fareast-language:DE-AT'> Daniel Grotti <<a href="mailto:dgrotti@sipwise.com">dgrotti@sipwise.com</a>> <br><b>Gesendet:</b> Dienstag, 21. August 2018 20:22<br><b>An:</b> Hohl Matthias <<a href="mailto:matthias.hohl@telematica.at">matthias.hohl@telematica.at</a>><br><b>Cc:</b> <a href="mailto:spce-user@lists.sipwise.com">spce-user@lists.sipwise.com</a><br><b>Betreff:</b> Re: AW: AW: [Spce-user] How to deal with non-numeric characters in a dialed number</span><o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Probably you would need to accept number starting with 0 and 00 as well.<o:p></o:p></p><div><p class=MsoNormal> <o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Daniel<o:p></o:p></p><div id=AppleMailSignature><p class=MsoNormal>Sent from my iPhone<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><br>On 21.08.2018, at 20:14, Hohl Matthias <<a href="mailto:matthias.hohl@telematica.at">matthias.hohl@telematica.at</a>> wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I tested it and i have to modificate it just a little but and now it is working </span><span lang=EN-US style='font-family:Wingdings;color:#1F497D'>J</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>If there is the number NOT in format +123 or 1234 it will do a log entry and also reply with 403 – dialed number is not numeric</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>This is the final working code under /etc/ngcp-config/templates/etc/kamailio/proxy/kamailio.cfg.customtt.tt2</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><i><span lang=EN-US style='color:#1F497D'>        if(is_method("INVITE") && !($rU =~ "^\+?[0-9]+$"))</span></i><o:p></o:p></p><p class=MsoNormal><i><span lang=EN-US style='color:#1F497D'>        {</span></i><o:p></o:p></p><p class=MsoNormal><i><span lang=EN-US style='color:#1F497D'>                xlog("L_WARN", "Dialed number is not numeric - '$rU' - [% logreq -%]\n");</span></i><o:p></o:p></p><p class=MsoNormal><i><span lang=EN-US style='color:#1F497D'>                sl_send_reply("403", "Dialed number is not numeric");</span></i><o:p></o:p></p><p class=MsoNormal><i><span lang=EN-US style='color:#1F497D'>                route(ROUTE_EXIT);</span></i><o:p></o:p></p><p class=MsoNormal><i><span lang=EN-US style='color:#1F497D'>        } </span></i><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=DE style='color:windowtext;mso-fareast-language:DE-AT'>Von:</span></b><span lang=DE style='color:windowtext;mso-fareast-language:DE-AT'> Daniel Grotti <<a href="mailto:dgrotti@sipwise.com">dgrotti@sipwise.com</a>> <br><b>Gesendet:</b> Dienstag, 21. August 2018 19:43<br><b>An:</b> Hohl Matthias <<a href="mailto:matthias.hohl@telematica.at">matthias.hohl@telematica.at</a>><br><b>Cc:</b> <a href="mailto:spce-user@lists.sipwise.com">spce-user@lists.sipwise.com</a><br><b>Betreff:</b> Re: AW: [Spce-user] How to deal with non-numeric characters in a dialed number</span><o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>At a first sight it looks good.<o:p></o:p></p><div><p class=MsoNormal>It worth a try.<o:p></o:p></p></div><div><p class=MsoNormal> <o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Daniel<o:p></o:p></p><div id=AppleMailSignature><p class=MsoNormal>Sent from my iPhone<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><br>On 21.08.2018, at 19:39, Hohl Matthias <<a href="mailto:matthias.hohl@telematica.at">matthias.hohl@telematica.at</a>> wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Hello Daniel,</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>i think this will work for reply 403 of the dialed number don’t match numeric number, right?</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='margin-left:0cm;text-indent:-18.0pt;mso-list:l1 level1 lfo2;background:white'><![if !supportLists]><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>       </span></span><![endif]><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'>        </span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#205081;mso-fareast-language:DE-AT'>if</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'>(is_method(</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#C42B44;mso-fareast-language:DE-AT'>"INVITE"</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'>) && ($rU !~ </span><span style='font-size:9.0pt;font-family:Consolas;color:#C42B44;mso-fareast-language:DE-AT'>"^\+?[0-9]+$"</span><span style='font-size:9.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'>))</span><o:p></o:p></p><p class=MsoNormal style='margin-left:0cm;text-indent:-18.0pt;mso-list:l1 level1 lfo2;background:white'><![if !supportLists]><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>       </span></span><![endif]><span style='font-size:9.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'>        {</span><o:p></o:p></p><p class=MsoNormal style='margin-left:0cm;text-indent:-18.0pt;mso-list:l1 level1 lfo2;background:white'><![if !supportLists]><span style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'>       </span></span><![endif]><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'>                xlog(</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#C42B44;mso-fareast-language:DE-AT'>"L_WARN"</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'>, </span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#C42B44;mso-fareast-language:DE-AT'>"Dialed number is not numeric - '$rU' - [% logreq_init -%]\n"</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'>);</span><o:p></o:p></p><p class=MsoNormal style='margin-left:0cm;text-indent:-18.0pt;mso-list:l1 level1 lfo2;background:white'><![if !supportLists]><span style='mso-list:Ignore'>4.<span style='font:7.0pt "Times New Roman"'>       </span></span><![endif]><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'>                sl_send_reply(</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#C42B44;mso-fareast-language:DE-AT'>"403"</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'>, </span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#C42B44;mso-fareast-language:DE-AT'>"Dialed number is not numeric"</span><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'>);</span><o:p></o:p></p><p class=MsoNormal style='margin-left:0cm;text-indent:-18.0pt;mso-list:l1 level1 lfo2;background:white'><![if !supportLists]><span style='mso-list:Ignore'>5.<span style='font:7.0pt "Times New Roman"'>       </span></span><![endif]><span lang=EN-US style='font-size:9.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'>                </span><span style='font-size:9.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'>route(ROUTE_EXIT);</span><o:p></o:p></p><p class=MsoNormal style='margin-left:0cm;text-indent:-18.0pt;mso-list:l1 level1 lfo2;background:white'><![if !supportLists]><span style='mso-list:Ignore'>6.<span style='font:7.0pt "Times New Roman"'>       </span></span><![endif]><span style='font-size:9.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'>        }</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=DE style='color:windowtext;mso-fareast-language:DE-AT'>Von:</span></b><span lang=DE style='color:windowtext;mso-fareast-language:DE-AT'> Spce-user <<a href="mailto:spce-user-bounces@lists.sipwise.com">spce-user-bounces@lists.sipwise.com</a>> <b>Im Auftrag von </b>Daniel Grotti<br><b>Gesendet:</b> Dienstag, 21. August 2018 14:01<br><b>An:</b> <a href="mailto:spce-user@lists.sipwise.com">spce-user@lists.sipwise.com</a><br><b>Betreff:</b> Re: [Spce-user] How to deal with non-numeric characters in a dialed number</span><o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><tt><span style='font-size:10.0pt'>H Matthias,</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br><tt>another option, instead of trying to consume the non-numeric number, is to make sure in kamailio that the dialed number match a numeric number series, if not you just reply 403 - not a numeric number. This will avoid the system to parse the call any further.</tt><br><br><tt>Solution from Barry is also ok, but the system will parse the call until the peer selection, and call will fails with "no peering rule found" (I think it's a 500 error).</tt><br><br><br><tt>Cheers,</tt><br><tt>Daniel</tt><br><br><br><br></span>On 08/21/2018 01:42 PM, Hohl Matthias wrote:<br><br><br><br><br><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><span style='color:#1F497D'>Hey Rene,</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I already thought on this but this is no real deal, cause then we will loose the money for this calls. If someone find out this trick to add a “ABC” behind the number and this will be rated as 0 cent then there will be a massive abuse potential.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>So easier would be to block all calls to this dialed numbers or the clear it like I descripe in option 2, but I don’t know the right regex to clear all non-numeric characters except a “+” on the first sign.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Can you maybe help me with this solution too?</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>My solution is just working for for -%()&*.,!“$ but not for letters or /x;:_=~@#§:[]\^°`´‘|<> and not if there is a “+” on the first sign.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Thank you.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=DE style='mso-fareast-language:DE-AT'>Von:</span></b><span lang=DE style='mso-fareast-language:DE-AT'> Rene Krenn <a href="mailto:rkrenn@sipwise.com"><rkrenn@sipwise.com></a> <br><b>Gesendet:</b> Dienstag, 21. August 2018 13:29<br><b>An:</b> 'Hohl Matthias' <a href="mailto:matthias.hohl@telematica.at"><matthias.hohl@telematica.at></a>; <a href="mailto:spce-user@lists.sipwise.com">spce-user@lists.sipwise.com</a><br><b>Betreff:</b> AW: [Spce-user] How to deal with non-numeric characters in a dialed number</span><o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>Hi,</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>why not adding two 0cent fees to cover, ie.:</span><o:p></o:p></p><p class=MsoListParagraph><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l2 level1 lfo4'><![if !supportLists]><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>       </span></span><![endif]><span style='color:#1F497D'>Non-digit source:</span><o:p></o:p></p><p class=MsoListParagraph><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>src: [^0-9+]+</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>dst: .</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l2 level1 lfo4'><![if !supportLists]><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>       </span></span><![endif]><span style='color:#1F497D'>Non-digit destination:</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>src: .</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>dst: [^0-9+]+</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>Note that 6.5 will bring fee „match modes“ (regex_longest_pattern/legacy, regex_longest_pattern, prefix, exact, etc.) for way more speed and flexibility.</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>regards</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=DE style='mso-fareast-language:DE-AT'>Von:</span></b><span lang=DE style='mso-fareast-language:DE-AT'> Spce-user [<a href="mailto:spce-user-bounces@lists.sipwise.com">mailto:spce-user-bounces@lists.sipwise.com</a>] <b>Im Auftrag von </b>Hohl Matthias<br><b>Gesendet:</b> Dienstag, 21. August 2018 13:17<br><b>An:</b> <a href="mailto:spce-user@lists.sipwise.com">spce-user@lists.sipwise.com</a><br><b>Betreff:</b> [Spce-user] How to deal with non-numeric characters in a dialed number</span><o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Hello,</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>we often have the problem, that an UA of a subscriber is dialing a number with non-numeric characters like “-%/” or also letters like “ABCD” and so on.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Everytime when this happens, our rate-o-mat stop working, cause there is no billing profile destination pattern for such kind of characters.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Normally our billing profile pattern looks like this: Source Pattern: “.” Destination Pattern:  </span><span lang=EN-US style='font-size:9.0pt'>^431.+$</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>My ideas to fix this problem:</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo6'><![if !supportLists]><span style='mso-list:Ignore'>1.)<span style='font:7.0pt "Times New Roman"'>    </span></span><![endif]><span lang=EN-US>If a UA is calling a non-numeric number, except “+” in the front, then the call should be blocked by SPCE. <br>So calls not formatted like #4312345 or 012345 should be blocked, without trying to reach a peering.<br>Is this possible? It would the easiest way to force a subscriber to dial correct numbers, otherwise calling is not working.</span><o:p></o:p></p><p class=MsoListParagraph><span lang=EN-US> </span><o:p></o:p></p><p class=MsoListParagraph><span lang=EN-US> </span><o:p></o:p></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo6'><![if !supportLists]><span style='mso-list:Ignore'>2.)<span style='font:7.0pt "Times New Roman"'>    </span></span><![endif]><span lang=EN-US>Clear special characters in the INVITE: </span><span lang=EN-US style='font-size:10.5pt;font-family:Consolas;color:white;background:#121212'>/etc/ngcp-config/templates/etc/kamailio/proxy/kamailio.cfg.customtt.tt2</span><o:p></o:p></p><p class=MsoNormal style='text-indent:35.4pt;line-height:15.0pt;vertical-align:baseline'><span lang=EN-US>I tried to edit the kamailio.cfg.tt2 and edit it to this:<br></span><i><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:DE-AT'>        if(is_method("INVITE"))</span></i><o:p></o:p></p><p class=MsoNormal style='line-height:15.0pt;vertical-align:baseline'><i><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:DE-AT'>        </span></i><i><span style='font-size:10.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:DE-AT'>{</span></i><o:p></o:p></p><p class=MsoNormal style='line-height:15.0pt;vertical-align:baseline'><i><span style='font-size:10.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:DE-AT'>                $rU = $(rU{re.subst,/^(\+)?[:blank:]?\(?([0-9]*)\)?[ -.]?\(?([0-9]*)\)?[ -.]?\(?([0-9]*)\)?[ -.]?\(?([0-9]*)\)?[ -.]?\(?([0-9]*)\)?$/\1\2\3\4\5\6/});</span></i><o:p></o:p></p><p class=MsoNormal style='line-height:15.0pt;vertical-align:baseline'><i><span style='font-size:10.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:DE-AT'>                </span></i><i><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:DE-AT'>xlog("L_NOTICE", "Consume special chars in RURI - '$rU' - [% logreq_init -%]\n");</span></i><o:p></o:p></p><p class=MsoNormal style='line-height:15.0pt;vertical-align:baseline'><i><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:DE-AT'>        </span></i><i><span style='font-size:10.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:DE-AT'>}</span></i><o:p></o:p></p><p class=MsoListParagraph><span lang=EN-US> </span><o:p></o:p></p><p class=MsoListParagraph><span lang=EN-US>But this way, just working for -%()&*.,!“$ but not for letters or /x;:_=~@#§:[]\^°`´‘|<><br>How do I have to edit this to clear everything witch is a non-numeric character or a number with a “+” in the front?</span><o:p></o:p></p><p class=MsoListParagraph><span lang=EN-US> </span><o:p></o:p></p><p class=MsoListParagraph><span lang=EN-US>Will this do the trick?</span><o:p></o:p></p><p class=MsoNormal style='text-indent:35.4pt;line-height:15.0pt;vertical-align:baseline'><i><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:DE-AT'>        if(is_method("INVITE"))</span></i><o:p></o:p></p><p class=MsoNormal style='line-height:15.0pt;vertical-align:baseline'><i><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:DE-AT'>        {</span></i><o:p></o:p></p><p class=MsoListParagraph><i><span style='font-size:10.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:DE-AT'>          </span>$rU = $(rU{re.subst,/[^0-9]//g});</i><o:p></o:p></p><p class=MsoNormal style='line-height:15.0pt;vertical-align:baseline'><i><span style='font-size:10.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:DE-AT'>                </span></i><i><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:DE-AT'>xlog("L_NOTICE", "Consume special chars in RURI - '$rU' - [% logreq_init -%]\n");</span></i><o:p></o:p></p><p class=MsoNormal style='line-height:15.0pt;vertical-align:baseline'><i><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:DE-AT'>        </span></i><i><span style='font-size:10.0pt;font-family:Consolas;color:#333333;border:none windowtext 1.0pt;padding:0cm;mso-fareast-language:DE-AT'>}</span></i><o:p></o:p></p><p class=MsoListParagraph><span lang=EN-US> </span><o:p></o:p></p><p class=MsoListParagraph> <o:p></o:p></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo6'><![if !supportLists]><span style='mso-list:Ignore'>3.)<span style='font:7.0pt "Times New Roman"'>    </span></span><![endif]><span lang=EN-US>Editing the Rewrite Rules to match also against non-numeric characters in a dialed number string. But I think this will cause more problems like it fix.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>How did you fix this problems? I think the easiest thing would be to block everything which is not perfect formatted (1.). Is this possible?</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>It would be very nice if you could assist me with this problem.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Thank you</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE-AT'>Mit freundlichen Grüßen,</span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE-AT'>Matthias Hohl</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:DE-AT'><br><br><br><br><br><br></span><o:p></o:p></p><pre>_______________________________________________<o:p></o:p></pre><pre>Spce-user mailing list<o:p></o:p></pre><pre><a href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a><o:p></o:p></pre><pre><a href="https://lists.sipwise.com/listinfo/spce-user">https://lists.sipwise.com/listinfo/spce-user</a><o:p></o:p></pre></blockquote><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:DE-AT'> </span><o:p></o:p></p></div></blockquote></div></div></blockquote></div></div></blockquote></div></div></div></body></html>