Eval( )

Eval( ) Evaluates any Asterisk variables located within a string

 Eval(   newvar   =   string   ) 

Processes the given string and evaluates any variables contained in the string. The resulting value is assigned to the variable newvar .

This application is used in situations where a string is used in the dialplan, but any variables contained within it need to be evaluated first. This is often the case when the string is retrieved from a database or other external source.

 ; go through some convoluted steps to create a string that contains     ; the unparsed variable ${UNIQUEID}     exten => 123,1,Set(ONE=$)     exten => 123,2,Set(TWO=$[{UNIQUEID}])     ; print the values to the console, to make sure it hasn't been parsed     exten => 123,3,NoOp(${ONE}${TWO})     ; now evaluate the variables in the string  exten => 123,4,Eval(TEST=${ONE}${TWO})  ; print the result to the console     exten => 123,5,NoOp(${TEST}) 

See Also

Exec( ) , ExecIf( )

Asterisk. The Future of Telephony
Asterisk: The Future of Telephony: The Future of Telephony
Year: 2001
Pages: 380

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net