hi
I’m having the simple AGI script,
#!/usr/bin/php -q
<?php set_time_limit(30); require('/var/lib/asterisk/agi-bin/phpagi.php'); $agi = new AGI(); $agi->answer(); $agi->set variable('vivek', '7979797979'); $agi->noop("Vivek testing"); ?>calling this script from dialplan:
[agitest]
exten => 4567,1,NoOp(*** for agi testing )
same => n,AGI(welcome.php,${CALLERID(num)})
same => n,NoOp( result from db is ${vivek} ***)
when executed the output in asterisk cli (agi set debug is on) is
– Executing [4567@agitest:1] NoOp(“SIP/4000-00000104”, “*** for agi testing ") in new stack
– Executing [4567@agitest:2] AGI(“SIP/4000-00000104”, “welcome.php,4000”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/welcome.php
<SIP/4000-00000104>AGI Tx >> agi_request: welcome.php
<SIP/4000-00000104>AGI Tx >> agi_channel: SIP/4000-00000104
<SIP/4000-00000104>AGI Tx >> agi_language: en
<SIP/4000-00000104>AGI Tx >> agi_type: SIP
<SIP/4000-00000104>AGI Tx >> agi_uniqueid: 1386152808.260
<SIP/4000-00000104>AGI Tx >> agi_version: 11.6.0
<SIP/4000-00000104>AGI Tx >> agi_callerid: 4000
<SIP/4000-00000104>AGI Tx >> agi_calleridname: 4000
<SIP/4000-00000104>AGI Tx >> agi_callingpres: 0
<SIP/4000-00000104>AGI Tx >> agi_callingani2: 0
<SIP/4000-00000104>AGI Tx >> agi_callington: 0
<SIP/4000-00000104>AGI Tx >> agi_callingtns: 0
<SIP/4000-00000104>AGI Tx >> agi_dnid: 4567
<SIP/4000-00000104>AGI Tx >> agi_rdnis: unknown
<SIP/4000-00000104>AGI Tx >> agi_context: agitest
<SIP/4000-00000104>AGI Tx >> agi_extension: 4567
<SIP/4000-00000104>AGI Tx >> agi_priority: 2
<SIP/4000-00000104>AGI Tx >> agi_enhanced: 0.0
<SIP/4000-00000104>AGI Tx >> agi_accountcode:
<SIP/4000-00000104>AGI Tx >> agi_threadid: -1266926736
<SIP/4000-00000104>AGI Tx >> agi_arg_1: 4000
<SIP/4000-00000104>AGI Tx >>
– <SIP/4000-00000104>AGI Script welcome.php completed, returning 0
– Executing [4567@agitest:3] NoOp(“SIP/4000-00000104”, " result from db is ***”) in new stack
– Auto fallthrough, channel ‘SIP/4000-00000104’ status is ‘UNKNOWN’
here in *** result from db is *** I want that variable ${vivek}.
please please help me anybody…thanks in advance