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

Adams, Gavin gadams at promisant.com
Fri Oct 24 11:23:57 MST 2003


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 




More information about the asterisk-users mailing list