使用PJSIP在两个Asterisk服务器之间构建通道/中继

问题描述 投票:1回答:1

新的星号版本(> 13)使用PJSIP模块而不是chan_sip。到目前为止,我所缺少的是如何使用星号正确使用PJSIP库的实际示例。

我想做的是以下内容:

  • 我在不同站点上有两个,三个或更多星号服务器,它们都通过IP连接
  • 像IP电话这样的终端设备连接到侧面的星号服务器,他们使用PJSIP(Asterisk <==> IP-Phone到目前为止工作)
  • 现在我想要将所有星号服务器相互连接,以便建立一个具有适当拨号方案的通信网络,其中每个终端设备都可以与其他站点上的另一个电话通信

像那样:[end-device <==> Asterisk1 <========> Asterisk2 <==>终端设备]

到目前为止,我只找到了如何使用chan_sip或IAX2进行教程的教程,但没有使用PJSIP。还有一些教程可以将星号服务器绑定到外部提供程序,但这不是我想要做的。

请帮助我,至少有关于该主题的丰富教程或信息网站的链接!

谢谢

asterisk pjsip
1个回答
0
投票

在两天的大部分时间里与之斗争之后,这是一个有效的配置(至少在一个方向上(服务器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()
© www.soinside.com 2019 - 2024. All rights reserved.