[Asterisk-Users] Removing "-" (Dash) from Dialed Numbers

Colin Anderson ColinA at landmarkmasterbuilder.com
Fri Sep 23 12:46:32 MST 2005


Not very elegant, but:
 
exten => 1,1,SetVar(MyNumber=780-555-1212)
exten => 1,2,SetVar(AreaCode=${MyNumber:3:3})
exten => 1,3,SetVar(Prefix=${MyNumber:5:7})
exten => 1,4,SetVar(Suffix=${MyNumber:8:11})
exten => 1,5,Dial(ZAP/g0/1${AreaCode}${Prefix}${Suffix})
 
hth

-----Original Message-----
From: Scott Miller [mailto:scoscmil at imap.iu.edu]
Sent: Friday, September 23, 2005 1:22 PM
To: asterisk-users at lists.digium.com
Subject: [Asterisk-Users] Removing "-" (Dash) from Dialed Numbers



I am trying to enable dial-by-email by using LDAPget to query an Active
Directory server.  I've got it retrieving the phone number fine.
Unforunately, the numbers stored in active directory are either in the
format:  (xxx) xxx-xxxx or xxx-xxx-xxxx.   Is there any way to parse
characters out of the dialed phone number so that I only end up with digits
(remove spaces, parenthesis and dashes)?   From there, my outbound routes
can take care of where to send the call.

 

Help is always appreciated! :-)  

 

Thank you,

Scott Miller

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050923/7b324e12/attachment.htm


More information about the asterisk-users mailing list