简体   繁体   中英

Variable value from php AGI not returning in Asterisk

I have this simple block of code that just set a variable:

require('/var/lib/asterisk/agi-bin/phpagi.php');
$agi=new AGI();

$agi->set_variable("V_Nome", "value");
exit();

But when I call it in Asterisk the variable is blank:

Asterisk:

same=>n,AGI(/var/lib/asterisk/agi-bin/empresario/sky/empresario_skyTeste_agi.php)
same=>n,NoOp(V_Nome --> ${V_Nome})

Log:

-- <SIP/g77-000116ce>AGI Script /var/lib/asterisk/agi-bin/empresario/sky/empresario_skyTeste_agi.php completed, returning 0
-- Executing [30@preventiva-sky-int:53] NoOp("SIP/g77-000116ce", "v_Nome --> ") in new stack

DEBUG is offtopic on SO

Use following:

asterisk -r
agi set debug on

Use Dumpchan instead of Noop

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM