Summary: | ASTERISK-09583: Setting a variable in the AGI using a dial plan function. | ||
Reporter: | Bill Kunyiha (bgitonga) | Labels: | |
Date Opened: | 2007-06-04 15:26:48 | Date Closed: | 2011-06-07 14:08:11 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Channels/chan_sip/CodecHandling |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ||
Description: | I have tried this with both perl and php and get the same results. I'm attempting to set a variable in Perl and PHP AGI. It works in the dial plan (extensions.conf) but not in the AGI script In extensions.conf, the following works exten => 105,1,Set(this_location=${DUNDILOOKUP(105|priv)}) this_location is set to what the DUNDILOOKUP function gets. But doing the same thing in the perl or php agi does not work. Please see bellow. $AGI->exec("Set","ring_group_string=${DUNDILOOKUP(105|priv)}"); this_location is set to the string ${DUNDILOOKUP(105|priv)}. Thus the DUNDILOOKUP function is never executed. I have tried escaping the symbols but this too does not help. Using the exec function does not work either. $AGI->exec("Set","ring_group_string=\$\{DUNDILOOKUP(105|priv)\}");}"); Which also sets this_location to the string ${DUNDILOOKUP(105|priv)} This might be a bug in the AGI. Please look into it. | ||
Comments: | By: Tilghman Lesher (tilghman) 2007-06-04 16:47:10 This is not a bug. You cannot use dialplan syntax in AGI, because AGI is not the dialplan. What you should be doing is retrieving the value of the function with: GET VARIABLE DUNDILOOKUP(105|priv) and then set the result with: SET VARIABLE ring_group_string "whatever" |