<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:"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;}
@font-face
        {font-family:"Open Sans";
        panose-1:2 11 6 6 3 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        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";}
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;
        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;}
span.E-MailFormatvorlage20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.E-MailFormatvorlage21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.E-MailFormatvorlage22
        {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:2107458571;
        mso-list-type:hybrid;
        mso-list-template-ids:426935194 201785359 201785369 201785371 201785359 201785369 201785371 201785359 201785369 201785371;}
@list l1:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1: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'>Hey Rene,<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'>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.<o:p></o:p></span></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.<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'>Can you maybe help me with this solution too?<o:p></o:p></span></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.<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'>Thank you.<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'><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='mso-fareast-language:DE-AT'>Von:</span></b><span lang=DE style='mso-fareast-language:DE-AT'> Rene Krenn <rkrenn@sipwise.com> <br><b>Gesendet:</b> Dienstag, 21. August 2018 13:29<br><b>An:</b> 'Hohl Matthias' <matthias.hohl@telematica.at>; spce-user@lists.sipwise.com<br><b>Betreff:</b> 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><span style='color:#1F497D'>Hi,<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'>why not adding two 0cent fees to cover, ie.:<o:p></o:p></span></p><p class=MsoListParagraph><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l1 level1 lfo2'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>       </span></span></span><![endif]><span style='color:#1F497D'>Non-digit source:<o:p></o:p></span></p><p class=MsoListParagraph><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>src: [^0-9+]+<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>dst: .<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l1 level1 lfo2'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>       </span></span></span><![endif]><span style='color:#1F497D'>Non-digit destination:<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'>src: .<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>dst: [^0-9+]+<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'>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.<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'>regards<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='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<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US>Hello,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></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.<o:p></o:p></span></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.<o:p></o:p></span></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;font-family:"Open Sans",sans-serif;color:#333333;background:white'>^431.+$</span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>My ideas to fix this problem:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo4'><![if !supportLists]><span lang=EN-US><span style='mso-list:Ignore'>1.)<span style='font:7.0pt "Times New Roman"'>    </span></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.<o:p></o:p></span></p><p class=MsoListParagraph><span lang=EN-US><o:p> </o:p></span></p><p class=MsoListParagraph><span lang=EN-US><o:p> </o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo4'><![if !supportLists]><span lang=EN-US><span style='mso-list:Ignore'>2.)<span style='font:7.0pt "Times New Roman"'>    </span></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><span lang=EN-US><o:p></o:p></span></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><i><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'><o:p></o:p></span></i></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><i><span style='font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'><o:p></o:p></span></i></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><i><span style='font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'><o:p></o:p></span></i></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><i><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'><o:p></o:p></span></i></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><i><span style='font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'><o:p></o:p></span></i></p><p class=MsoListParagraph><span lang=EN-US><o:p> </o:p></span></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?<o:p></o:p></span></p><p class=MsoListParagraph><span lang=EN-US><o:p> </o:p></span></p><p class=MsoListParagraph><span lang=EN-US>Will this do the trick?<o:p></o:p></span></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><i><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'><o:p></o:p></span></i></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 lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'><o:p></o:p></span></i></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><i><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'><o:p></o:p></span></i></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><i><span style='font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:DE-AT'><o:p></o:p></span></i></p><p class=MsoListParagraph><span lang=EN-US><o:p> </o:p></span></p><p class=MsoListParagraph><o:p> </o:p></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo4'><![if !supportLists]><span lang=EN-US><span style='mso-list:Ignore'>3.)<span style='font:7.0pt "Times New Roman"'>    </span></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.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></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?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>It would be very nice if you could assist me with this problem.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Thank you<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:DE-AT'>Mit freundlichen Grüßen,<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:DE-AT'>Matthias Hohl<o:p></o:p></span></p></div></body></html>