voiplist
2007-Aug-13 00:52 UTC
[asterisk-users] How strip +1 from caller id on inbound call
[This email is either empty or too large to be displayed at this time]
Trevor Peirce
2007-Aug-13 01:07 UTC
[asterisk-users] How strip +1 from caller id on inbound call
voiplist wrote:> From some of our telecom providers we get the caller-id as: > NXXNXXXXXX > > From others we get: > +1NXXNXXXXXX > > We are trying to standardize the way our caller-id comes in so we > would like to strip off the +1 from the inbound caller id. > > Can anyone offer any suggestions? >This is untested, but I think something like this ought to do it- exten => s,n,ExecIf($["${CALLERID(num):0:1}" = "1"], Set, CALLERID(num)=${CALLERID(num):1}) Trevor -- Does your Canadian VoIP service need CRTC-compliant 9-1-1 services? Please visit http://www.digitalcon.ca/voip9-1-1/ to find out more!
you can do like this:
exten => _X.,1,GoSubIf($[${LEN(${CALLERID(num)})}>10]?strip1);if it's
longer than grab the last 10 digits of the CIDNUM
exten =>
_X.,50(strip1),Set(CALLERID(num)=${CALLERID(num):$[${LEN(${CALLERID(num)})}-10]});this
grabs the last 10 digits of CALLERID(num) and sets it to CALLERID(num)
exten => _X.,n,Return()
Hope this helps.
On 8/12/07, voiplist <gotvoip at gmail.com> wrote:> From some of our telecom providers we get the caller-id as:
> NXXNXXXXXX
>
> From others we get:
> +1NXXNXXXXXX
>
> We are trying to standardize the way our caller-id comes in so we
> would like to strip off the +1 from the inbound caller id.
>
> Can anyone offer any suggestions?
>
> I have tried:
> ;exten => +18664918575,1,Set(CALLERID(all)=${CALLERIDNAME}
<${CALLERIDNUM:2}>)
>
> but it just yacks..
>
> Thanks in advance for any help.
>
> Regards,
> Todd R.
>
> --
> Prestige Messaging
> Live Answering Services
> SIP or Toll-Free Connectivity
> Light Accounts From $14.95/mo
> http://www.PrestigeMessaging.com
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>