SIP呼叫被星号拒绝

时间:2013-01-30 06:34:54

标签: ruby sip asterisk agi

我正在使用Asterisk和Adhearsion。我创建了ahn应用程序并做了以下事情:

dialplan.rb添加到项目的根目录。内容:

adhearsion {
  play 'hello-world'
  hangup
}

config/adhearsion.rb的内容:

  ...
  ##
  # Use with Asterisk
  #
  config.punchblock.platform = :asterisk # Use Asterisk
  config.punchblock.username = "myuser" # Your AMI username
  config.punchblock.password = "mypassword" # Your AMI password
  config.punchblock.host = "127.0.0.1" # Your AMI host
  ...

Asterisk配置文件:

extensions.conf

[adhearsion]
exten => test,1,AGI(agi://127.0.0.1)                                                                                                                                      

[adhearsion-redirect]

sip.conf

的内容
[general]
context=adhearsion
....

当我从SJPhone应用程序调用(SIP)时出现错误:

== Manager 'myuser' logged on from 127.0.0.1
  == Manager 'myuser' logged on from 127.0.0.1
    -- Added extension '1' priority 1 to adhearsion-redirect
  == Using SIP RTP CoS mark 5
    -- Executing [test@adhearsion:1] AGI("SIP/127.0.0.1-00000000", "agi://127.0.0.1") in new stack
[Jan 30 12:02:26] ERROR[4211]: utils.c:1164 ast_carefulwrite: write() returned error: Connection refused
[Jan 30 12:02:26] WARNING[4211]: res_agi.c:1509 launch_netscript: Connect to 'agi://127.0.0.1' failed: Connection refused
    -- Auto fallthrough, channel 'SIP/127.0.0.1-00000000' status is 'UNKNOWN'

1 个答案:

答案 0 :(得分:2)

这意味着星号无法连接adhearsion fastagi脚本。

可能的问题是:

  • adhearsion未运行。启动它。
  • 防火墙阻止adhearsion端口。添加到端口4573(tcp)的防火墙允许规则
  • adhearsion框架内的一些错误,请参阅日志。