FastAGI的get_data函数问题总是立即返回1

时间:2018-04-23 11:02:19

标签: php ubuntu-16.04 asterisk fastagi

所以我已经实现了fastagi但是我遇到了get_data函数的问题,无法播放音频文件,从最终用户接收DTMF并返回。我遇到的问题是一切似乎都开始了,但是音频文件没有播放(这个文件与agi和fastagi一起工作就可以访问它)并且该函数立即返回1。请参阅下面的日志摘录,我正在运行Ubuntu 16.04和星号13.1.0:

日志:

<SIP/208_fleek-00000008>AGI Rx << VERBOSE "IVRs found = 1" 1
agi://192.168.20.144/agi-bin/ivr.php,fleek,5,1,,23: IVRs found = 1
<SIP/208_fleek-00000008>AGI Tx >> 200 result=1
<SIP/208_fleek-00000008>AGI Rx << GET DATA /usr/share/asterisk/sounds/fleek_ivr 2000 10
 -- <SIP/208_fleek-00000008> Playing '/usr/share/asterisk/sounds/fleek_ivr.slin' (language 'en')
<SIP/208_fleek-00000008>AGI Rx << VERBOSE "Selection detected: 1" 1
 agi://192.168.20.144/agi-bin/ivr.php,fleek,5,1,,23: Selection detected: 1
<SIP/208_fleek-00000008>AGI Tx >> 200 result=1

php代码:

        $name = '/usr/share/asterisk/sounds/fleek_ivr';
            $timeout = $row2['timeout'];
            $ntimeout = 2000;
            $expect = '10';
            $ivr = $fastagi->get_data($name,$ntimeout,$expect);
            $fastagi->verbose("Selection detected: ".$ivr['result']);
            $dtmf = $ivr['result'];

拨号计划代码:

[function_ivr]
exten => _X.,1,Answer()
 same => n,Noop('type is ${dtype}..... type id is ${dtype_id} BLABLABLABLA)
 same => n,AGI(ivr.php)
 same => n,AGI(agi://X.X.X.X/agi-bin/ivr.php,fleek,5,1,,23
 same => n,Hangup

2 个答案:

答案 0 :(得分:0)

使用以下内容进行调试

asterisk -r
agi set debug on

之后的电话

在SO

上,DEBUG OFFTOPIC

答案 1 :(得分:0)

星号首先需要一个答案,以使其起作用