簡體   English   中英

使用 PJSIP 在兩個 Asterisk 服務器之間建立通道/中繼

[英]Building channels/trunks between two Asterisk servers with PJSIP

新的星號版本 (>13) 使用 PJSIP 模塊而不是 chan_sip。 到目前為止,我缺少的是如何正確使用帶有星號的 PJSIP 庫的實際示例。

我想要做的是以下內容:

  • 我在不同的站點上有兩個、三個或更多星號服務器,它們都通過 IP 連接
  • 像 IP 電話這樣的終端設備連接到兩側的星號服務器,它們使用 PJSIP(Asterisk<==>IP-Phone 到目前為止有效)
  • 現在我想將所有星號服務器相互連接起來,以建立一個具有適當撥號計划的通信網絡,其中每個終端設備都可以與其他站點上的另一部電話進行通信

像這樣:[終端設備<==>Asterisk1<========>Asterisk2<==>終端設備]

到目前為止,我只找到了如何使用 chan_sip 或 IAX2 執行此操作的教程,但未找到使用 PJSIP 的教程。 還有幾個可用的教程將星號服務器綁定到外部提供程序,但這不是我想要做的。

請幫助我,至少提供有關該主題的豐富教程或信息網站的鏈接!

謝謝

在與此斗爭了兩天的大部分時間之后,這是一個有效的配置(至少在一個方向上(serverB 上的電話是遠程的,因此我無法輕松測試)。

我希望它可以幫助其他人避免我所經歷的痛苦:-)

;
; 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()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM