我已经用Asterisk配置了Issabel。
[root@issabel ~]# asterisk -V
Asterisk 11.25.3
在etcasteriskhttp.conf中启用了迷你http服务器,在etcasteriskmanager.conf中启用了管理员访问。
http.conf:
#include http_additional.conf
#include http_custom.conf
[general]
enabled=yes
enablestatic=yes
bindaddr=0.0.0.0
bindport=8080
prefix=
tlsenable=no
tlsbindaddr=
tlscertfile=
tlsprivatekey=
manager. conf:
[general]
enabled = yes
bindaddr = 0.0.0.0
port = 5038
#include manager_general_additional.conf
[admin]
username = foo
secret = bar
#deny=0.0.0.0/0.0.0.0
permit=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate
write = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate
writetimeout = 5000
httptimeout = 36000
#include manager_additional.conf
#include manager_custom.conf
我试图根据这篇文章创建一些API:[ ]。https:/wiki.asterisk.orgwikidisplayASTAllow+Manager+Access+via+HTTP][1] 。
文章中说,首先我必须通过以下方式登录。http:/localhost:8088manager?action=login&username=foo&secret=bar。
当然,我的本地网络中有Isabel服务器,所以我试图从Chrome浏览器登录:http:/。192.168.0.100:8088manager?action=login&username=foo&secret=bar。
结果如下。
Not Found
The requested URL was not found on this server.
Asterisk Server
服务器上的端口是开放的,监听的,没有防火墙阻挡 - 我可以通过命令行telnet这些端口8080和5038。
netstat在我的issabel服务器上。
[root@issabel ~]# netstat -tlpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 1181/smbd
tcp 0 0 0.0.0.0:4190 0.0.0.0:* LISTEN 2414/cyrus-master
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 2414/cyrus-master
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 2414/cyrus-master
tcp 0 0 127.0.0.1:20004 0.0.0.0:* LISTEN 2558/php
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2011/mysqld
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 1181/smbd
tcp 0 0 0.0.0.0:5038 0.0.0.0:* LISTEN 2526/asterisk
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 2414/cyrus-master
tcp 0 0 0.0.0.0:4559 0.0.0.0:* LISTEN 2587/hfaxd
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 2414/cyrus-master
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 2526/asterisk
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 981/sshd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 1658/master
tcp6 0 0 :::443 :::* LISTEN 979/httpd
tcp6 0 0 :::445 :::* LISTEN 1181/smbd
tcp6 0 0 :::4190 :::* LISTEN 2414/cyrus-master
tcp6 0 0 :::993 :::* LISTEN 2414/cyrus-master
tcp6 0 0 :::995 :::* LISTEN 2414/cyrus-master
tcp6 0 0 :::139 :::* LISTEN 1181/smbd
tcp6 0 0 :::110 :::* LISTEN 2414/cyrus-master
tcp6 0 0 :::143 :::* LISTEN 2414/cyrus-master
tcp6 0 0 :::80 :::* LISTEN 979/httpd
tcp6 0 0 :::22 :::* LISTEN 981/sshd
tcp6 0 0 :::25 :::* LISTEN 1658/master
我的目标是,向我的呼叫中心操作员显示呼叫号码,在我的本地数据库中找到这些号码,并在我们的基于网络的信息系统中显示呼叫者的名字和所需的数据,以处理切割者。
[root@issabel static-http]# ls -la ./
total 696
drwxrwxr-x 2 asterisk asterisk 4096 Jul 15 2019 .
drwxrwxr-x. 14 asterisk asterisk 4096 Jun 8 06:12 ..
-rw-rw-r-- 1 asterisk asterisk 6066 Jun 6 2018 ajamdemo.html
-rw-rw-r-- 1 asterisk asterisk 461 Jun 6 2018 astman.css
-rw-rw-r-- 1 asterisk asterisk 7912 Jun 6 2018 astman.js
-rw-rw-r-- 1 asterisk asterisk 573949 Jun 6 2018 core-en_US.xml
-rw-rw-r-- 1 asterisk asterisk 4170 Jun 6 2018 mantest.html
-rw-rw-r-- 1 asterisk asterisk 96653 Jun 6 2018 prototype.js
任何提示感谢
你还需要在正确的位置安装网页文件。
检查你的文件是否在varlibasteriskstatic-http中。
好了,我解决了这个问题,感谢@arheops给我指出了问题所在,我的服务器上没有html js php文件。我的服务器上没有html js php文件,我通过svn下载了这些文件,放在了正确的文件夹里,安装后,现在API工作了。