AGI: #!/usr/bin/php -q answer(); $dovid = $agi->get_variable(ABC); $agi->verbose($dovid, $level=1); ?> Extensions.conf Exten => _X.,1,Set(ABC=${EXTEN}) Exten => _X.,2,AGI(test.agi) CLI Output: == Parsing '/etc/asterisk/users.conf': Found -- Executing [123456@test:1] Set("SIP/100-0a0e34d0", "ABC=123456") in new stack -- Executing [123456@test:2] AGI("SIP/100-0a0e34d0", "test.agi") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/test.agi AGI Tx >> agi_request: test.agi AGI Tx >> agi_channel: SIP/100-0a0e34d0 AGI Tx >> agi_language: en AGI Tx >> agi_type: SIP AGI Tx >> agi_uniqueid: 947650108.137 AGI Tx >> agi_callerid: 100 AGI Tx >> agi_calleridname: Exten 100 AGI Tx >> agi_callingpres: 0 AGI Tx >> agi_callingani2: 0 AGI Tx >> agi_callington: 0 AGI Tx >> agi_callingtns: 0 AGI Tx >> agi_dnid: 123456 AGI Tx >> agi_rdnis: unknown AGI Tx >> agi_context: test AGI Tx >> agi_extension: 123456 AGI Tx >> agi_priority: 2 AGI Tx >> agi_enhanced: 0.0 AGI Tx >> agi_accountcode: AGI Tx >> AGI Rx << ANSWER AGI Tx >> 200 result=0 AGI Rx << GET VARIABLE ABC AGI Tx >> 200 result=1 (123456) AGI Rx << VERBOSE "Array" 1 test.agi: Array AGI Tx >> 200 result=1 AGI Rx << VERBOSE "(" 1 test.agi: ( AGI Tx >> 200 result=1 AGI Rx << VERBOSE " [code] => 200" 1 test.agi: [code] => 200 AGI Tx >> 200 result=1 AGI Rx << VERBOSE " [result] => 1" 1 test.agi: [result] => 1 AGI Tx >> 200 result=1 AGI Rx << VERBOSE " [data] => 123456" 1 test.agi: [data] => 123456 AGI Tx >> 200 result=1 AGI Rx << VERBOSE ")" 1 test.agi: ) AGI Tx >> 200 result=1 AGI Rx << VERBOSE "" 1 test.agi: AGI Tx >> 200 result=1 -- AGI Script test.agi completed, returning 0 == Auto fallthrough, channel 'SIP/100-0a0e34d0' status is 'UNKNOWN' pbx*CLI>