[asterisk-dev] [Code Review] Add EXPORT dialplan function: set variable on another channel

tim.ringenbach at gmail.com tim.ringenbach at gmail.com
Wed Jun 23 18:06:06 CDT 2010

This is an automatically generated e-mail. To reply, visit:

Review request for Asterisk Developers.


Adds a dialplan function named EXPORT that lets you set channel variables on other channels. It is based on IMPORT. Originally it was ExportVar based on ImportVar, but while porting to 1.8 I noticed ImportVar was depreciated.

You can set either a simple variable or a function.
Example dialplan that sets a function (you would 'console dial XXXX at test-local'):

exten => _X.,1,NoOp()
exten => _X.,n,Set(EXPORT(${TEST},CDR(userfield))=blah)
exten => _X.,n,Dial(SIP/sometrunk/${EXTEN})

exten => _X.,1,NoOp()
exten => _X.,n,Set(__TEST=${CHANNEL})
exten => _X.,n,Dial(Local/${EXTEN}@test/n)


  http://svn.asterisk.org/svn/asterisk/trunk/funcs/func_logic.c 272331 

Diff: https://reviewboard.asterisk.org/r/742/diff


I tested it by dialing on the console, using variations of the simple dialplan above, testing setting both variables and functions, and using 'core show channel' to verify everything was set correctly.



More information about the asterisk-dev mailing list