通信人家园

标题: SIP—Trunk配置  [查看完整版帖子] [打印本页]

时间:  2012-8-21 11:40
作者: upper.hua     标题: SIP—Trunk配置

两台asterisk 服务器用SIP-trunk对接:
Server A
首先在sip.conf 里面添加trunk
[serverB]                    /对接的服务器的/
type = friend
host = 172.16.8.164           /对接的服务器的IP/
username = serverA
secret = 111
context = incoming            /对接后从服务器B呼入到服务A后在A上所走的规则/
disallow = all
allow = ulaw
然后在sip.conf 里面添加SIP分机:
[200]
type=friend
username=200
secret=200
host=dynamic
context=from-internal         /此为从SIP 200的分机呼出时所走的规则/
extensions.conf中添加以下规则:
[from-internal]
exten => _X., 1,Dial(sip/serverB/${EXTEN})
exten => _X., n, Hangup
[incoming]
exten => _X., 1, answer()
exten => _X., 2, playback(demo-instruct)
exten => _X., n, goto(2)
同理server B
首先在sip.conf 里面添加trunk
[serverA]                        /对接的服务器的/
type = friend                    
host = 172.16.42.254              /对接的服务器的IP/
username = serverB
secret = 111
context = incoming                /对接后从服务器B呼入到服务A后在A上所走的规则/
disallow = all
disallow = all
allow = ulaw
然后在sip.conf 里面添加SIP分机:
[100]
type=friend
username=100
secret=100
host=dynamic
context=from-internal
extensions.conf中添加以下规则:
[from-internal]
exten => _X., 1,Dial(sip/serverA/${EXTEN})
exten => _X., n, Hangup
[incoming]
exten => _X., 1, answer()
exten => _X., 2, playback(demo-instruct)
exten => _X., n, goto(2)






通信人家园 (https://www.txrjy.com/) Powered by C114