[Spce-user] Inbound Rewrite Rule for Callee - strip characters in dialed numbers

Barry Flanagan barry at flanagan.ie
Tue Sep 26 04:11:49 EDT 2017


On 26 September 2017 at 07:44, Matthias Hohl <matthias.hohl at telematica.at>
wrote:

> Hello...
>
> Has anyone an idea, how to solve this?
>
> Thank you
>
> Am 13.09.2017 um 15:52 schrieb Matthias Hohl <matthias.hohl at telematica.at
> >:
>
> Hello,
>
>
>
> we have sometimes the problem, that customers dial a number with letters
> or characters like „.“ Or „-„ or „/“ in it.
>
> This stops rate-o-mat, so we need to rewrite the dialed number to strip
> out this characters.
>
>
>
> Like: [^0-9]  =>  „“
>
>
You could use something like:

        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 spec chars in RURI - '$rU' - [%
logreq_init -%]\n");
        }


..in your templates/etc/kamailio/proxy/kamailio.cfg.customtt.tt2

Hope this helps.

-Barry Flanagan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20170926/156faccd/attachment-0001.html>


More information about the Spce-user mailing list