- 论坛徽章:
- 0
|
centos5,asterisk service在公网上
安装了asterisk 1.6.2 通过Installing Asterisk With Yum
http://www.asterisk.org/downloads/yum
安装成功
配置sip.conf
context=default
allowoverlap=no
udpbindaddr=0.0.0.0
bindport=5060
qualify=yes
nat=yes
[101]
type=friend
secret=101
host=dynamic
context=internal
username=101
callgroup=1
pickupgroup=1
[102]
type=friend
secret=102
host=dynamic
context=internal
username=102
callgroup=1
pickupgroup=1
extensions.conf
[default]
[internal]
exten=>101,1,Dial(SIP/101,20) ;20 is timeout
exten=>102,1,Dial(SIP/102,20)
========
我使用xlite进行连接,总返回
timeout 408
我在asterisk CLI是看不到连接信息的,没有任何信息
在桌面上用wireshark进行看包,发现只有发出的SIP包,没有服务器的响应包
==================
上网搜索一下,说可能是firewall的原因
因此,我用此方法打开了5060,10000-20000 UDP
# iptables -A INPUT -p udp -m udp --dport 5060 -j ACCEPT
# iptables -A INPUT -p udp -m udp --dport 10000:20000 -j ACCEPT
如此:我机器的状态如下iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 acctboth all -- 0.0.0.0/0 0.0.0.0/0
2 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:5060
3 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpts:10000:20000
这样我在登录,还是返回time out 408
我以为崩溃了,然后用
tcpdump udp port 5060在服务器上来查看有没有来自客户端的包
x-lite尝试登录,但发现没有UDP过来在服务器上看不到,通过上面命令
===========
那位大哥知道原因,请告之,我弄了好几天了 |
|