[asterisk-users] Cut off + sign in telephonenumber

Johan Wilfer lists at jttech.se
Tue Mar 20 11:07:47 CDT 2012


2012-03-20 16:36, Jonas Kellens skrev:
> Hello,
>
> I'm trying to cut off the "+" sign if part of a telephone number, but
> not succeeding :
>
> exten => test,n,Set(cid=+99999600)
> exten => test,n,Set(regx="([0-9])")
> exten => test,n,Set(cid2=$["${cid}" : ${regx}])
> exten => test,n,NoOp(cid2=${cid2})
>
> cid2 is empty afterwards...
>
>
> What I want is to make sure there are only numbers and no other
> characters.
>
> So +99999600 needs to become 99999600 (without + )
> So 99999#600 needs to become 99999600 (without # )
>

Maybe the FILTER function could suit your needs?

https://wiki.asterisk.org/wiki/display/AST/Function_FILTER

/Johan

-- 
Johan Wilfer                 email: johan at jttech.se
JT Tech | Developer          webb: http://jttech.se

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120320/a60e13c2/attachment.htm>


More information about the asterisk-users mailing list