[Asterisk-Users] How to use the Cut() command to chop off an ending character

Andrew Joakimsen andrew at envisionstudio.net
Fri Oct 24 12:11:32 MST 2003


I don't see what the problem is, Asterisk will see them as two separate
extensions

Exten => _9011xxxxxxxxx#,1,StripLSD(1)      (or _9011.# if there is not
a fixed number of digits, change the other xxxxxxx to be .)
Exten => _9011xxxxxxxxx,2,Dial(IAX2/${exten:1}@.....  (or exten:4 if you
do not need to send off the 011)


And then have another one for when you don't press #

Exten => _9011xxxxxxxxxx,1,Dial(IAX2/${exten:1}@.....

Regards,
 
 

> -----Original Message-----
> From: asterisk-users-admin at lists.digium.com [mailto:asterisk-users-
> admin at lists.digium.com] On Behalf Of Adams, Gavin
> Sent: Friday, October 24, 2003 2:24 PM
> To: asterisk-users at lists.digium.com
> Subject: [Asterisk-Users] How to use the Cut() command to chop off an
> ending character
> 
> pamAssassin 2.55 (1.174.2.19-2003-05-19-exp)
> 
> I used to be able to pass dial strings to IAX2 providers with #
> characters at the end of the string. This is how we end dial strings
for
> international calls.
> 
> So, I would like to be able to selectivity chop off any # characters
at
> the end of string, only if they exist. Basically as follows (chopping
> off the leading '9' with ${EXTEN:1} syntax:
> 
> EXTEN from Phone        EXTEN for Dial String
> 
> 9011445551212#          011445551212
> 9011445551212           011445551212
> 
> StripLSD isn't helpful in the second case, but potentially Cut could
do
> it. I can't, for the life of me, figure out the syntax for Cut to do
> this. Understood that I need to set a new variable with the result of
> Cut and use this as the dial string.
> 
> Any optimal way to chop off the errant # (and maybe the leading 9 at
the
> same time)????
> 
> Regards,
> 
> --- Gavin Adams
> Promisant (Technology) Ltd.
> Atlanta, GA
> 
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list