新的星号版本(> 13)使用PJSIP模块而不是chan_sip。到目前为止,我所缺少的是如何使用星号正确使用PJSIP库的实际示例。
我想做的是以下内容:
像那样:[end-device <==> Asterisk1 <========> Asterisk2 <==>终端设备]
到目前为止,我只找到了如何使用chan_sip或IAX2进行教程的教程,但没有使用PJSIP。还有一些教程可以将星号服务器绑定到外部提供程序,但这不是我想要做的。
请帮助我,至少有关于该主题的丰富教程或信息网站的链接!
谢谢
在两天的大部分时间里与之斗争之后,这是一个有效的配置(至少在一个方向上(服务器B上的电话是远程的,所以我不能轻易测试)。
我希望它可以帮助别人避免我经历的痛苦:-)
;
; ServerA - pjsip.conf
;
[siptrunk-auth]
type = auth
auth_type = userpass
username = <USER>
password = <ASTRONGPASSWORD>
[siptrunk-aor]
type = aor
contact = sip:serverB.domain.tld
[siptrunk]
type = endpoint
context = from-serverB
allow = !all,g722,ulaw
outbound_auth = siptrunk-auth
aors = siptrunk-aor
direct_media = no
[siptrunk-registration]
type = registration
outbound_auth = siptrunk-auth
server_uri = sip:serverB.domain.tld
client_uri = sip:<USER>@serverB.domain.tld
retry_interval = 60
[siptrunk-identify]
type = identify
match = serverB.domain.tld
endpoint = siptrunk
;
; ServerB - pjsip.conf
;
; <USER> is the same <USER> as on Server A
;
[<USER>] ;
type = auth
auth_type = userpass
username = <USER>
password = <ASTRONGPASSWORD>
[<USER>]
type = aor
max_contacts = 1
[<USER>]
type = endpoint
context = from-ServerA
allow = !all,ulaw
direct_media = no
auth = <USER>
aors = <USER>
[<USER>]
type = identity
match = ServerA.domain.tld ; sometimes you might need to use the actual IP Address
endpoint = <USER>
;
; ServerA - extensions.conf
;
[to-serverB]
; route extensions starting with 6XXX to Server B
exten => _6XXX,1,Dial(PJSIP/${EXTEN}@siptrunk,,25)
same => n,Hangup()
;
; ServerB - extensions.conf
;
[to-serverA]
; route extensions starting with 7XXX to Server A
exten => _7XXX,1,Dial(PJSIP/${EXTEN}@<USER>,,25)
same => n,Hangup()