[asterisk-users] How to get values of local channels context

Yuan LIU yliu11 at hotmail.com
Wed Feb 28 22:24:56 MST 2007


>From: kjcsb <kjcsb at yahoo.com>
>Date: Wed, 28 Feb 2007 18:23:46 -0800 (PST)
>
> >Check out /path/to/src/asterisk/doc/README.variables
>
>${DIALEDPEERNUMBER} would give it to me if I sliced it up.
>exten => s,n,Set(Foo=${CUT(DIALEDPEERNUMBER,@,2)})
>exten => s,n,Set(Foo=${CUT(Foo,/n,1)})
>
>Are there any better options?
>
>Cameron

This is beautiful.  How much better can it get?  Syntax-wise, you can 
combine the two lines into one because the value of CUT() can be used inside 
another function including CUT().  Using inheritable variable could be an 
alternative.  But efficiency difference is neglegible.

Yuan Liu




More information about the asterisk-users mailing list