[Spce-user] How to deal with non-numeric characters in a dialed number

Hohl Matthias matthias.hohl at telematica.at
Tue Aug 21 09:32:43 EDT 2018


If i jump back to second solution to consume non-numeric characters, will this do the job?

 

if(is_method("INVITE"))
{
    $rU = $(rU{re.subst,/[^\+0-9]/});
    $rU = $(rU{re.subst,/^\+/});
    xlog("L_NOTICE", "Consume special chars in RURI - '$rU' - [% logreq_init -%]\n");
}

 

First search for everything beginning with + and numbers and consume the rest of the string and second will then consume all + and leave just the beginning +, is there is any.

 

Von: Barry Flanagan <barry at flanagan.ie> 
Gesendet: Dienstag, 21. August 2018 13:50
An: Matthias Hohl <matthias.hohl at telematica.at>
Cc: Rene Krenn <rkrenn at sipwise.com>; spce-user at lists.sipwise.com
Betreff: Re: [Spce-user] How to deal with non-numeric characters in a dialed number

 

On Tue, 21 Aug 2018 at 12:43, Hohl Matthias <matthias.hohl at telematica.at <mailto:matthias.hohl at telematica.at> > wrote:

Hey Rene,

 

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.

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.

 

Can you maybe help me with this solution too?

My solution is just working for for -%()&*.,!“$ but not for letters or /x;:_=~@#§:[]\^°`´‘|<> and not if there is a “+” on the first sign.

 

 

Why no just alter your Peering Rules Callee patterns to only accept purely numeric. Then such calls simply would not find a route and fail.

 

-Barry Flanagan

 

 

 

Thank you.

 

 

Von: Rene Krenn <rkrenn at sipwise.com <mailto:rkrenn at sipwise.com> > 
Gesendet: Dienstag, 21. August 2018 13:29
An: 'Hohl Matthias' <matthias.hohl at telematica.at <mailto:matthias.hohl at telematica.at> >; spce-user at lists.sipwise.com <mailto:spce-user at lists.sipwise.com> 
Betreff: AW: [Spce-user] How to deal with non-numeric characters in a dialed number

 

Hi,

 

why not adding two 0cent fees to cover, ie.:

 

1.       Non-digit source:

 

src: [^0-9+]+

dst: .

 

2.       Non-digit destination:

 

src: .

dst: [^0-9+]+

 

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.

 

regards

 

Von: Spce-user [mailto:spce-user-bounces at lists.sipwise.com] Im Auftrag von Hohl Matthias
Gesendet: Dienstag, 21. August 2018 13:17
An: spce-user at lists.sipwise.com <mailto:spce-user at lists.sipwise.com> 
Betreff: [Spce-user] How to deal with non-numeric characters in a dialed number

 

Hello,

 

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.

Everytime when this happens, our rate-o-mat stop working, cause there is no billing profile destination pattern for such kind of characters.

Normally our billing profile pattern looks like this: Source Pattern: “.” Destination Pattern:  ^431.+$

 

My ideas to fix this problem:

 

1.)    If a UA is calling a non-numeric number, except “+” in the front, then the call should be blocked by SPCE. 
So calls not formatted like #4312345 or 012345 should be blocked, without trying to reach a peering.
Is this possible? It would the easiest way to force a subscriber to dial correct numbers, otherwise calling is not working.

 

 

2.)    Clear special characters in the INVITE: /etc/ngcp-config/templates/etc/kamailio/proxy/kamailio.cfg.customtt.tt2

I tried to edit the kamailio.cfg.tt2 and edit it to this:
        if(is_method("INVITE"))

        {

                $rU = $(rU{re.subst,/^(\+)?[:blank:]?\(?([0-9]*)\)?[ -.]?\(?([0-9]*)\)?[ -.]?\(?([0-9]*)\)?[ -.]?\(?([0-9]*)\)?[ -.]?\(?([0-9]*)\)?$/\1\2\3\4\5\6/});

                xlog("L_NOTICE", "Consume special chars in RURI - '$rU' - [% logreq_init -%]\n");

        }

 

But this way, just working for -%()&*.,!“$ but not for letters or /x;:_=~@#§:[]\^°`´‘|<>
How do I have to edit this to clear everything witch is a non-numeric character or a number with a “+” in the front?

 

Will this do the trick?

        if(is_method("INVITE"))

        {

          $rU = $(rU{re.subst,/[^0-9]//g});

                xlog("L_NOTICE", "Consume special chars in RURI - '$rU' - [% logreq_init -%]\n");

        }

 

 

3.)    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.

 

 

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?

It would be very nice if you could assist me with this problem.

 

Thank you

 

Mit freundlichen Grüßen,

Matthias Hohl

_______________________________________________
Spce-user mailing list
Spce-user at lists.sipwise.com <mailto:Spce-user at lists.sipwise.com> 
https://lists.sipwise.com/listinfo/spce-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20180821/8e0ed728/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5532 bytes
Desc: not available
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20180821/8e0ed728/attachment-0001.p7s>


More information about the Spce-user mailing list