Asterisk AMI没有收听端口5038

Ant*_*ony 3 asterisk

我有一个在ubuntu上运行星号的实例,我能够执行.call脚本并观察它们通过"asterisk -rcvvvvv"运行,但我无法通过telnet按照http://的教程连接到它-asterisk-book.com/1.6/asterisk-manager-api.html.(我正在调试为什么我的PHP代码无法连接)

我已更新/etc/asterisk/manager.conf并使用以下命令重新启动星号:

[general]
enabled = yes
port = 5038
bindaddr = 127.0.0.1

#include "manager.d/*.conf"

[admin]
secret = abc123
deny = 0.0.0.0/0.0.0.0
permit = 127.0.0.1/255.255.255.255
read = all,system,call,log,verbose,command,agent,user,config
write = all,system,call,log,verbose,command,agent,user,config
Run Code Online (Sandbox Code Playgroud)

我为localhost打开了防火墙:

sudo ufw allow from 127.0.0.1 to any port 5038
Run Code Online (Sandbox Code Playgroud)

但是,如果我检查运行telnet localhost 5038 ...

Trying ::1...
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
Run Code Online (Sandbox Code Playgroud)

当我运行netstat -plnt时,我也看不到它在听:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:2000            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:11300         0.0.0.0:*               LISTEN      -
tcp6       0      0 :::80                   :::*                    LISTEN      -
tcp6       0      0 :::22                   :::*                    LISTEN      -
tcp6       0      0 ::1:5432                :::*                    LISTEN      -
Run Code Online (Sandbox Code Playgroud)

还有什么我应该做的让它听5038端口?

Ant*_*ony 5

找到了答案.在http://the-asterisk-book.com/1.6/asterisk-manager-api.html的示例中,他们说要将[admin]添加到manager.conf的底部.它需要进入一个新文件,如/etc/asterisk/manager.d/admin.conf

重新启动了星号,它向右射击.