简体   繁体   中英

PHP AGI GET VARIABLE result=1 but data is empty

I'm using phpagi (Asterisk).
this is my code:

$clinicId = $agi->get_variable('C_ID');

the AGI log show result is 1 and the value is 7611 but when I'm using $clinicId['data'] its empty.

AGI log:

AGI Rx << GET VARIABLE C_ID
AGI Tx >> 200 result=1 (7611)
AGI Rx << VERBOSE "MyLog: C_ID ::: {"code":"200","result":"1","data":""}"

what am i doing wrong ??

You are writting your debug info into STDOUT probably.

That is most common error wich result get_var be incorrect.

STDOUT used by AGI itself. So you can't use it in script without broke phpagi.php library.

I am facing with the same problem, I have tried to debug more, but i could not found the solution.

I try and see that $str return from $this->in is "200 result=1" So, data is missing. I could not fix that and Hope you can share the code to handle, fix that issue.

I am trying to get DIALSTATUS after Dial command.

Thank all so much.

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