[Asterisk-Users] cannonicalizing phone num in macro

Randy Bush randy at psg.com
Tue Sep 14 12:25:08 MST 2004


i am in a macro.  ${ARG2} is a phone number, which might be
seven, ten, or eleven digits.  i wish to canonicalize it to
be a full 11 digit number.  if this was a normal exten, i
would

   exten => _1XXXXXXXXXX,1,GoTo(dial-gateway,${EXTEN},1)
   exten => _XXXXXXXXXX,1,GoTo(dial-gateway,1${EXTEN},1)
   exten => _XXXXXXX,1,GoTo(pstn,1${areacode}${EXTEN},1)

but how to hack it inside a macro?

randy




More information about the asterisk-users mailing list