[Spce-user] EEA and nonEEA Calle/Caller Pattern differentiation for Peering Group in mr5.5.2

Rene Krenn rkrenn at sipwise.com
Tue Feb 13 18:50:55 EST 2018


>should I change it there also?

Yes. Also, the lookbehind should be delimited by enclosing parantheses.

 

^sip:(?!(43|49|32)).+$

 

Furthermore the lookbehind regexp-part is subject to some limitations, depending on the engine (see  https://www.regular-expressions.info/lookaround.html). 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).

 

It‘s otherwise a good idea to try the regexp either in mariadb console or at an (online) tester.

 

regards

 

Von: Hohl Matthias [mailto:matthias.hohl at telematica.at] 
Gesendet: Mittwoch, 14. Februar 2018 00:29
An: 'Rene Krenn' <rkrenn at sipwise.com>; 'Spce-user' <Spce-user at lists.sipwise.com>
Betreff: AW: [Spce-user] EEA and nonEEA Calle/Caller Pattern differentiation for Peering Group in mr5.5.2

 

Hey Rene,

 

Thank for confirmation… I will test it tomorrow… 

 

About “in front of”:

In our last conversation about negative lookahead in the billing profile, I also used it inside the capturing group… 

^(?!43800|43810|43820|43821|43900|43930|43901|43931|43939).+$

 

As I can remember, this also worked… should I change it there also?

 

 

 

Von: Rene Krenn [mailto:rkrenn at sipwise.com] 
Gesendet: Dienstag, 13. Februar 2018 23:08
An: 'Hohl Matthias' <matthias.hohl at telematica.at <mailto:matthias.hohl at telematica.at> >; 'Spce-user' <Spce-user at lists.sipwise.com <mailto:Spce-user at lists.sipwise.com> >
Betreff: AW: [Spce-user] EEA and nonEEA Calle/Caller Pattern differentiation for Peering Group in mr5.5.2

 

Hi,

 

basically sounding; the deny case is the interesting one, you should try to pull that negative lookahead in front of the the capturing group:

 

Callee Pattern: ^sip:?!(43|49|32).+$

 

regards

 

Von: Spce-user [mailto:spce-user-bounces at lists.sipwise.com] Im Auftrag von Hohl Matthias
Gesendet: Dienstag, 13. Februar 2018 22:48
An: 'Spce-user' <Spce-user at lists.sipwise.com <mailto:Spce-user at lists.sipwise.com> >
Betreff: [Spce-user] EEA and nonEEA Calle/Caller Pattern differentiation for Peering Group in mr5.5.2

 

Hello,

 

i need your REGEX help…

 

I need to allow and deny calls from a subscriber with a specific NPN to a peering group.

 

1.)    Allow:

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.

Every other country code, for example +1 and +86, should NOT be allowed to place a call over this group.

 

Callee Pattern: ^sip:(43|49|32).+$

Caller Pattern: ^sip:(43|49|32).+$

 

 

2.)    Deny:

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.

Every other country code, for example +1 and +86, should be allowed to place a call over this group.

 

Callee Pattern: ^sip:(?!43|49|32).+$

Caller Pattern: empty

 

 

Are this the right pattern for my scenario?

 

Thank you.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20180214/046b112c/attachment-0001.html>


More information about the Spce-user mailing list