ソフトフォンをアスタリスクにリンクする方法

ソフトフォンをアスタリスクにリンクする方法

コンテキストを提供するための私のネットワークは次のとおりです。

ローカルエリアネットワーク

tleilaxサーバーにはsipsak総督の結果が明らかにあります。

tleilax*CLI> 
tleilax*CLI> core show version
Asterisk 1.8.29.0-vici built by abuild @ cloud110 on a x86_64 running Linux on 2014-08-21 23:18:17 UTC
tleilax*CLI> 
[Feb 20 21:06:19] 
<--- SIP read from UDP:192.168.1.3:44226 --->
OPTIONS sip:345@tleilax SIP/2.0
Via: SIP/2.0/UDP 127.0.1.1:44226;branch=z9hG4bK.508a6d72;rport;alias
From: sip:[email protected]:44226;tag=2a099edc
To: sip:345@tleilax
Call-ID: [email protected]
CSeq: 1 OPTIONS
Contact: sip:[email protected]:44226
Content-Length: 0
Max-Forwards: 0
User-Agent: sipsak 0.9.6
Accept: text/plain

<------------->
[Feb 20 21:06:19] --- (11 headers 0 lines) ---
[Feb 20 21:06:19] Looking for 345 in trunkinbound (domain tleilax)
[Feb 20 21:06:19] 
<--- Transmitting (NAT) to 192.168.1.3:44226 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 127.0.1.1:44226;branch=z9hG4bK.508a6d72;alias;received=192.168.1.3;rport=44226
From: sip:[email protected]:44226;tag=2a099edc
To: sip:345@tleilax;tag=as5d21da5c
Call-ID: [email protected]
CSeq: 1 OPTIONS
Server: Asterisk PBX 1.8.29.0-vici
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:192.168.1.2:5060>
Accept: application/sdp
Content-Length: 0


<------------>
[Feb 20 21:06:19] Scheduling destruction of SIP dialog '[email protected]' in 32000 ms (Method: OPTIONS)
[Feb 20 21:06:38] Really destroying SIP dialog '[email protected]' Method: OPTIONS
[Feb 20 21:06:51] Really destroying SIP dialog '[email protected]' Method: OPTIONS
tleilax*CLI> exit
tleilax:~ # 

メッセージを doge送信するには:sipsak

thufir@doge:~$ 
thufir@doge:~$ sudo sipsak -vv -s sip:345@tleilax -m "hi"
No SRV record: _sip._tcp.tleilax
No SRV record: _sip._udp.tleilax
using A record: tleilax
Max-Forwards set to 0

message received:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 127.0.1.1:44226;branch=z9hG4bK.508a6d72;alias;received=192.168.1.3;rport=44226
From: sip:[email protected]:44226;tag=2a099edc
To: sip:345@tleilax;tag=as5d21da5c
Call-ID: [email protected]
CSeq: 1 OPTIONS
Server: Asterisk PBX 1.8.29.0-vici
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:192.168.1.2:5060>
Accept: application/sdp
Content-Length: 0



** reply received after 0.794 ms **
   SIP/2.0 200 OK
   final received
thufir@doge:~$ 

いくつかの携帯電話を試しましたが、この携帯電話は電話つながる:

This assistant is now finished.
You can at any time check your registration state or modify your accounts parameters in the Options/Accounts window.

Alias :   345
Server :   tleilax
Username :   345
Security: None

接続されていることを示す「200 OK」というメッセージは表示されません。接続の問題を解決するにはどうすればよいですか?両方のコンピュータは同じネットワーク上にあり、互いにpingできます。ソフトフォンが「200 OK」メッセージを受け取らないssh理由を理解できません。他のソフトフォンでは同様の結果が表示されますが、「試行中」とのみ表示されます。dogetleilax

ユーザー:

tleilax*CLI> 
tleilax*CLI> sip show users
Username                   Secret           Accountcode      Def.Context      ACL  Forcerport
101                        password         101              default          No   Yes       
gs102                      password         gs102            default          No   Yes       
tleilax*CLI> 
tleilax*CLI> sip show user 101


  * Name       : 101
  Secret       : <Set>
  MD5Secret    : <Not set>
  Context      : default
  Language     : en
  Accountcode  : 101
  AMA flags    : Unknown
  Netborder CPD: No
  Transfer mode: open
  MaxCallBR    : 384 kbps
  CallingPres  : Presentation Allowed, Not Screened
  Call limit   : 0
  Callgroup    : 
  Pickupgroup  : 
  Callerid     : "" <101>
  ACL          : No
  Sess-Timers  : Accept
  Sess-Refresh : uas
  Sess-Expires : 1800 secs
  Sess-Min-SE  : 90 secs
  RTP Engine   : asterisk
  Codec Order  : (ulaw:20,gsm:20)
  Auto-Framing:  No 

tleilax*CLI> 

構成ファイル:

tleilax:~ # 
tleilax:~ # cat /etc/asterisk/sip.conf
[general]

...

#include sip-vicidial.conf

; register SIP account on remote machine if using SIP trunks
; register => testSIPtrunk:[email protected]:5060
;
; setup account for SIP trunking:
; [SIPtrunk]
; disallow=all
; allow=ulaw
; allow=alaw
; type=friend
; username=testSIPtrunk
; secret=test
; host=10.10.10.16
; dtmfmode=inband
; qualify=1000
tleilax:~ # 
tleilax:~ # cat /etc/asterisk/sip-vicidial.conf
; WARNING- THIS FILE IS AUTO-GENERATED BY VICIDIAL, ANY EDITS YOU MAKE WILL BE LOST



[101]
username=101
secret=password
accountcode=101
callerid="" <101>
mailbox=101
context=default
type=friend
host=dynamic

[gs102]
username=gs102
secret=password
accountcode=gs102
callerid="Test Admin Phone" <>
mailbox=102
context=default
type=friend
host=dynamic


; END OF FILE    Last Forced System Reload: 2015-02-20 16:49:28
tleilax:~ # 

ベストアンサー1

したがって、localnetとnatを設定する必要があります。

externip = X.X.X.X
fromdomain = yourdomain.com
localnet = 192.168.X.0/255.255.255.0
qualify=yes

http://www.voip-info.org/wiki/view/Asterisk+SIP+NAT+solutions

おすすめ記事