Tips

Linux asterisk 第5回

コールが失敗した際のログ

extensions.conf を以下のように編集してコールをしてみた。

[default]
exten=>2001,1,Dial(SIP/2001,30,r)
exten=>2001,2,Hangup()

4444のSIPクライアント側から 2001 に向けてコールしてみる
するとコールが鳴らなかった。
以下はその際に asteriskでデバッグしていたログ

<--- SIP read from UDP:192.168.10.126:3115 --->


<------------->
Really destroying SIP dialog 'YjNmYzZhMDI3MWEzNDY4Njk5ZGVjZThlZGJmZmI0ZGE' Method: ACK

<--- SIP read from UDP:192.168.10.126:3115 --->
INVITE sip:2001@192.168.10.127 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.126:3115;branch=z9hG4bK-d8754z-d7df573697413140-1---d8754z-;rport
Max-Forwards: 70
Contact: <sip:4444@192.168.10.126:3115>
To: <sip:2001@192.168.10.127>
From: "4444"<sip:4444@192.168.10.127>;tag=aa511b9c
Call-ID: NDNkYjc5Y2Y0MmIwMDdkZGFlOTQ4OWVmMjExZTFkZmE
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Content-Type: application/sdp
Supported: replaces
User-Agent: X-Lite release 4.5 stamp 69607
Content-Length: 249

v=0
o=- 13008754869255619 1 IN IP4 192.168.10.126
s=X-Lite 4 release 4.5 stamp 69607
c=IN IP4 192.168.10.126
t=0 0
m=audio 55584 RTP/AVP 9 8 0 100 101
a=rtpmap:100 speex/16000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
<------------->
--- (13 headers 10 lines) ---
Sending to 192.168.10.126:3115 (NAT)
Using INVITE request as basis request - NDNkYjc5Y2Y0MmIwMDdkZGFlOTQ4OWVmMjExZTFkZmE
Found peer '4444' for '4444' from 192.168.10.126:3115

<--- Reliably Transmitting (NAT) to 192.168.10.126:3115 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.10.126:3115;branch=z9hG4bK-d8754z-d7df573697413140-1---d8754z-;received=192.168.10.126;rport=3115
From: "4444"<sip:4444@192.168.10.127>;tag=aa511b9c
To: <sip:2001@192.168.10.127>;tag=as227e2927
Call-ID: NDNkYjc5Y2Y0MmIwMDdkZGFlOTQ4OWVmMjExZTFkZmE
CSeq: 1 INVITE
Server: Asterisk PBX 1.8.20.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="47a00bb9"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog 'NDNkYjc5Y2Y0MmIwMDdkZGFlOTQ4OWVmMjExZTFkZmE' in 32000 ms (Method: INVITE)

<--- SIP read from UDP:192.168.10.126:3115 --->
ACK sip:2001@192.168.10.127 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.126:3115;branch=z9hG4bK-d8754z-d7df573697413140-1---d8754z-;rport
Max-Forwards: 70
To: <sip:2001@192.168.10.127>;tag=as227e2927
From: "4444"<sip:4444@192.168.10.127>;tag=aa511b9c
Call-ID: NDNkYjc5Y2Y0MmIwMDdkZGFlOTQ4OWVmMjExZTFkZmE
CSeq: 1 ACK
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---

<--- SIP read from UDP:192.168.10.126:3115 --->
INVITE sip:2001@192.168.10.127 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.126:3115;branch=z9hG4bK-d8754z-81bdcf5a6d0141db-1---d8754z-;rport
Max-Forwards: 70
Contact: <sip:4444@192.168.10.126:3115>
To: <sip:2001@192.168.10.127>
From: "4444"<sip:4444@192.168.10.127>;tag=aa511b9c
Call-ID: NDNkYjc5Y2Y0MmIwMDdkZGFlOTQ4OWVmMjExZTFkZmE
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Content-Type: application/sdp
Supported: replaces
User-Agent: X-Lite release 4.5 stamp 69607
Authorization: Digest username="4444",realm="asterisk",nonce="47a00bb9",uri="sip:2001@192.168.10.127",response="3cab3c063b2c0eafd34cda726400f858",algorithm=MD5
Content-Length: 249

v=0
o=- 13008754869255619 1 IN IP4 192.168.10.126
s=X-Lite 4 release 4.5 stamp 69607
c=IN IP4 192.168.10.126
t=0 0
m=audio 55584 RTP/AVP 9 8 0 100 101
a=rtpmap:100 speex/16000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
<------------->
--- (14 headers 10 lines) ---
Sending to 192.168.10.126:3115 (NAT)
Using INVITE request as basis request - NDNkYjc5Y2Y0MmIwMDdkZGFlOTQ4OWVmMjExZTFkZmE
Found peer '4444' for '4444' from 192.168.10.126:3115
  == Using SIP RTP CoS mark 5
Found RTP audio format 9
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 100
Found RTP audio format 101
Found audio description format speex for ID 100
Found audio description format telephone-event for ID 101
Capabilities: us - 0x80000008000e (gsm|ulaw|alaw|h263|testlaw), peer - audio=0x20000100c (ulaw|alaw|speex16|g722)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 192.168.10.126:55584
Looking for 2001 in default (domain 192.168.10.127)

<--- Reliably Transmitting (NAT) to 192.168.10.126:3115 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 192.168.10.126:3115;branch=z9hG4bK-d8754z-81bdcf5a6d0141db-1---d8754z-;received=192.168.10.126;rport=3115
From: "4444"<sip:4444@192.168.10.127>;tag=aa511b9c
To: <sip:2001@192.168.10.127>;tag=as227e2927
Call-ID: NDNkYjc5Y2Y0MmIwMDdkZGFlOTQ4OWVmMjExZTFkZmE
CSeq: 2 INVITE
Server: Asterisk PBX 1.8.20.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<------------>
[Mar 26 16:02:16] NOTICE[31239]: chan_sip.c:23272 handle_request_invite: Call from '4444' (192.168.10.126:3115) to extension '2001' rejected because extension not found in context 'default'.
Scheduling destruction of SIP dialog 'NDNkYjc5Y2Y0MmIwMDdkZGFlOTQ4OWVmMjExZTFkZmE' in 32000 ms (Method: INVITE)

<--- SIP read from UDP:192.168.10.126:3115 --->
ACK sip:2001@192.168.10.127 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.126:3115;branch=z9hG4bK-d8754z-81bdcf5a6d0141db-1---d8754z-;rport
Max-Forwards: 70
To: <sip:2001@192.168.10.127>;tag=as227e2927
From: "4444"<sip:4444@192.168.10.127>;tag=aa511b9c
Call-ID: NDNkYjc5Y2Y0MmIwMDdkZGFlOTQ4OWVmMjExZTFkZmE
CSeq: 2 ACK
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---

asteriskを再起動したら正常にコールされた。
どうやら extensions.conf ファイルを編集したら asterisk を再起動する必要があるらしい。
再起動せずとも読み込ませる方法があるのかもしれないが現段階では分かっていない。(その後 asterisk のコンソールで dialplan reload すればよいことがわかった)
以下はその際に asterisk でデバッグしたログ

== Using SIP RTP CoS mark 5 ←ここから
— Executing [2001@default:1] Dial(“SIP/4444-00000000”, “SIP/2001,30,r”) in new stack
== Using SIP RTP CoS mark 5
— Called SIP/2001
— SIP/2001-00000001 is ringing
— SIP/2001-00000001 answered SIP/4444-00000000
— Locally bridging SIP/4444-00000000 and SIP/2001-00000001
[Mar 26 16:09:08] NOTICE[31534]: res_rtp_asterisk.c:2355 ast_rtp_read: Unknown RTP codec 126 received from ‘192.168.10.126:54574’
[Mar 26 16:09:18] NOTICE[31534]: res_rtp_asterisk.c:2355 ast_rtp_read: Unknown RTP codec 126 received from ‘192.168.10.126:54574’ ←ここまではコールを開始した際に出てきたログ
== Spawn extension (default, 2001, 1) exited non-zero on ‘SIP/4444-00000000’ ←このログは接続を終了した際に出てきた。

Linux認定資格 LPICを取るなら・・

Linux資格 「LPIC Lv1」徹底解説 連載目次

Recent News

Recent Tips

Tag Search