Passing Values Back to the Dialplan
From Etel
Contents |
[edit]
Title
Passing Values Back to the Dialplan
[edit]
Problem
Asterisk doesn't allow you to pass values from an AGI script directly back to the dialplan.
[edit]
Solution
Passing a value from a script, back into the dialplan, can be done indirectly using the "SET VARIABLE" directive. The syntax is "SET VARIABLE variable value".
[edit]
Discussion
The line in your Perl script might look something like:
print "SET VARIABLE myresult Fred";
In PHP, it might look like:
echo "SET VARIABLE myresult 555-1212";
You can then use the variable in the dialplan, or process it with the dial plan. As long as you didn't declare the variable as a global, it will be unique to the specific call and will "disappear" at the end of the call. This technique is valuable if you're writing your own AGI scripts for things like CID lookups, hot-desking, and the like.
[edit]
See Also:
[edit]
Metadata
- By: Tim Kramer
