本文介绍了AGI脚本执行无错误,但未生成结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用星号AGI运行Shell脚本。我使用了这里提到的教程



我的extensions.conf如下

  [默认] 
include => clicall

[clicall]
exten => _X,1,Goto(s,1);
扩展=> _X。,1,Goto(s,1);
扩展=> s,1,Answer();
扩展=> s,n,EAGI(runEAGI.sh);

我要运行的脚本(runEAGI.sh)如下

 #!/ bin / bash 
java / home / sphata001 / Downloads / EAGI / JEAGIClient $$

权限已设置为755,脚本位于 / var / lib / asterisk / agi-bin / 。 Java文件(JEAGIClient)也已经预先编译。手动执行脚本时,它可以正常运行并连接到服务器。
但是,当从SIP客户端发出呼叫时,脚本会根据星号控制台执行,但看不到结果。
我在控制台中得到以下输出

  ==使用SIP RTP CoS标记5 
-在新堆栈
中执行[888 @ default:1] Goto( SIP / 1001-00000027, s,1)-Goto(默认,s,1)
-执行[s @default:1]在新堆栈
中回答( SIP / 1001-00000027,)-执行[s @ default:2] EAGI( SIP / 1001-00000027, runEAGI.sh )在新堆栈
中-启动了AGI脚本/var/lib/asterisk/agi-bin/runEAGI.sh
-< SIP / 1001-00000027> AGI脚本runEAGI.sh完成,返回0
-自动掉线,通道'SIP / 1001-00000027'状态为'未知'

有解决方案吗?



谢谢。

解决方案

最可能-您需要指定Java的完整路径。



提示:要调试星号,AGI的简单解决方案是停止星号并将其启动并附加到控制台,这样您将看到所有脚本错误。

  asterisk -rx立即停止 
asterisk -vvvvgc

也可以很满在星号控制台中启用AGI调试:

  agi在

I am trying to run a shell script using asterisk AGI. I have used the tutorial mentioned here http://www.shiffman.net/p5/asterisk/

My extensions.conf is as follows

[default]
include => clicall

[clicall]
exten => _X,1,Goto(s,1);
exten => _X.,1,Goto(s,1);
exten => s,1,Answer();
exten => s,n,EAGI(runEAGI.sh);

The script I am trying to run (runEAGI.sh) is as follows

#!/bin/bash
java /home/sphata001/Downloads/EAGI/JEAGIClient $$

The permissions have been set as 755 and the script is placed in /var/lib/asterisk/agi-bin/. The java file(JEAGIClient) has been compiled beforehand as well . When executing the script manually it runs fine and connects to the server.But when making a call from SIP client the script executes according to asterisk console but no results are to seen.I get the following output in the console

 == Using SIP RTP CoS mark 5
    -- Executing [888@default:1] Goto("SIP/1001-00000027", "s,1") in new stack
    -- Goto (default,s,1)
    -- Executing [s@default:1] Answer("SIP/1001-00000027", "") in new stack
    -- Executing [s@default:2] EAGI("SIP/1001-00000027", "runEAGI.sh") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/runEAGI.sh
    -- <SIP/1001-00000027>AGI Script runEAGI.sh completed, returning 0
    -- Auto fallthrough, channel 'SIP/1001-00000027' status is 'UNKNOWN'

Any solutions?

Thank you.

解决方案

Most likly - you need specify full path to java.

Hint: For debugging asterisk AGI simple solution is stop asterisk and start it attached to console, that way you will see all script errors.

asterisk -rx "core stop now"
asterisk -vvvvgc

Also can be usfull enable AGI debugging in asterisk console:

agi set debug on

这篇关于AGI脚本执行无错误,但未生成结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-03 18:47