<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;}
/* 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;}
p
        {mso-style-priority:99;
        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;}
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-MailFormatvorlage19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.E-MailFormatvorlage20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.E-MailFormatvorlage21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.E-MailFormatvorlage22
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.E-MailFormatvorlage23
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.E-MailFormatvorlage24
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
p.simpara, li.simpara, div.simpara
        {mso-style-name:simpara;
        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.importantsign
        {mso-style-name:important_sign;}
.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:412163349;
        mso-list-type:hybrid;
        mso-list-template-ids:835348564 -1825258374 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;
        margin-left:18.0pt;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:54.0pt;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:90.0pt;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:126.0pt;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:162.0pt;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:198.0pt;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:234.0pt;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:270.0pt;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:306.0pt;
        text-indent:-9.0pt;}
@list l1
        {mso-list-id:1133596386;
        mso-list-template-ids:-406681464;}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
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 lang=EN-US style='color:#1F497D'>i validate it today with an online validator and it looks like booth is working:<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>Variant 1:   ^sip:(?!(43|49|3222)).+$<span style='color:#1F497D'><o:p></o:p></span></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Variant 2:   </span><span lang=EN-US>^sip:(?!43|49|3222).+$<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>But this not: ^sip:?!(43|49|3222).+$</span><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><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>it is necessary to add the “<a href="sip:">sip:</a>” in front to identify, that the match pattern is directly on beginning of the number.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Do I also need a pattern in this format “<a href="sips:">sips:</a>” for TLS calls? <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'>I tested it now with a simplier pattern, but found out another problem with the right peer routing and run out of order to find a solution…<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>My biggest problem is that “callee prefix” identifying is the highest priority and that I can’t set this prefix directly on subscriber and need to greate a rewrite rule for that.<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'>How do I set this “callee prefix” without breaking my rate-o-mat?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I tried with a rewrite rule on subscriber manipulating the “inbound rewrite rule for callee” and set there a prefix but this will break rate-o-mat.<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'>Also I tried around a bit to find another solution, but if “callee_prefix” will be always be on highest priority I can’t use this peering group with a lower priority like my main peering group…<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 anybody can give me the right advice how I can force a subscriber to place calls primary over a specific peering?<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><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><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 [mailto:rkrenn@sipwise.com] <br><b>Gesendet:</b> Mittwoch, 14. Februar 2018 00:51<br><b>An:</b> 'Hohl Matthias' <matthias.hohl@telematica.at>; 'Spce-user' <Spce-user@lists.sipwise.com><br><b>Betreff:</b> AW: [Spce-user] EEA and nonEEA Calle/Caller Pattern differentiation for Peering Group in mr5.5.2<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'>></span><span lang=EN-US style='color:#1F497D'>should I change it there also?</span><span style='color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Yes. Also, the lookbehind should be delimited by enclosing parantheses.<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>^sip:(?!(43|49|32)).+$</span><span style='color:#1F497D'><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'>Furthermore the lookbehind regexp-part is subject to some limitations, depending on the engine (see  <a href="https://www.regular-expressions.info/lookaround.html">https://www.regular-expressions.info/lookaround.html</a>). It explicitly states alternation groups like above are possible but eg. perl seem to require egual-length substrings (which is fine for 43800, 43810, .. -> they all have a length of 5).<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'>It‘s otherwise a good idea to try the regexp either in mariadb console or at an (online) tester.<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'> Hohl Matthias [<a href="mailto:matthias.hohl@telematica.at">mailto:matthias.hohl@telematica.at</a>] <br><b>Gesendet:</b> Mittwoch, 14. Februar 2018 00:29<br><b>An:</b> 'Rene Krenn' <<a href="mailto:rkrenn@sipwise.com">rkrenn@sipwise.com</a>>; 'Spce-user' <<a href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a>><br><b>Betreff:</b> AW: [Spce-user] EEA and nonEEA Calle/Caller Pattern differentiation for Peering Group in mr5.5.2<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Hey Rene,<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 for confirmation… I will test it tomorrow… <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'>About “in front of”:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>In our last conversation about negative lookahead in the billing profile, I also used it inside the capturing group… <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#333333;background:white'>^(?!43800|43810|43820|43821|43900|43930|43901|43931|43939).+$</span><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><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>As I can remember, this also worked… should I change it there also?<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><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 [<a href="mailto:rkrenn@sipwise.com">mailto:rkrenn@sipwise.com</a>] <br><b>Gesendet:</b> Dienstag, 13. Februar 2018 23:08<br><b>An:</b> 'Hohl Matthias' <<a href="mailto:matthias.hohl@telematica.at">matthias.hohl@telematica.at</a>>; 'Spce-user' <<a href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a>><br><b>Betreff:</b> AW: [Spce-user] EEA and nonEEA Calle/Caller Pattern differentiation for Peering Group in mr5.5.2<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'>basically sounding; the deny case is the interesting one, you should try to pull that negative lookahead in front of the the capturing group:<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>Callee Pattern: ^sip:?!(43|49|32).+$<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, 13. Februar 2018 22:48<br><b>An:</b> 'Spce-user' <<a href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a>><br><b>Betreff:</b> [Spce-user] EEA and nonEEA Calle/Caller Pattern differentiation for Peering Group in mr5.5.2<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hello,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US>i need your REGEX help…<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>I need to allow and deny calls from a subscriber with a specific NPN to a peering group.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoListParagraph style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![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>Allow:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Every call from a subscriber with a NPN beginning with country code 43, 49 or 32 calling a number in country 43, 49 or 32 should be allowed to place the call over this peering group.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Every other country code, for example +1 and +86, should NOT be allowed to place a call over this group.<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>Callee Pattern: ^sip:(43|49|32).+$<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Caller Pattern: ^sip:(43|49|32).+$<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=MsoListParagraph style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![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>Deny:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Every call from a subscriber with a NPN beginning with country code 43, 49 or 32 calling a number in country 43, 49 or 32 should NOT be allowed to place the call over this peering group.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Every other country code, for example +1 and +86, should be allowed to place a call over this group.<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>Callee Pattern: ^sip:(?!43|49|32).+$<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Caller Pattern: empty<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>Are this the right pattern for my scenario?<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></div></body></html>