[sip-comm-dev] sip-communicator <-> asterisk communication


#1

Hi all,

After testing the java sip-communicator user-agent [1] with asterisk [2], I found that it wasn't working. Here's what I saw after registration:

invite ->
<-407
ack ->
invite /w proxy credentials ->
<- 100
<- 200
<- 200 *
<- 200
etc.

* according to the sip-communicator logs, it only gets one 200 message from asterisk.

conclusions:

sip-communicator doesn't send an ACK to the 2nd invite/100/200 sequence, and asterisk tries to retransmit until it receives an ACK.

asterisk garbles the SDP in retransmitting the 200 OK message. Content-length stays the same, yet there are some extra bytes on the end during retransmission.

Am I right? I've included the logs inline so that others can validate my claims. My apologies for the long post and the word wrapping that might occur.

logs for sip-communicator starting at the 2nd invite,
and continuing to the last 200 message received from asterisk.

···

--------------------------------------------------------------
<message
from="192.168.3.44:5060"
to="192.168.3.18:5060"
time="1082113903972"
isSender="true"
transactionId="z9hg4bk9ccdda05565c85c31ef1f27980f342f9"
callId="d6e12283021906af516b4d9318a90fc1@192.168.3.44"
firstLine="INVITE sip:600@192.168.3.18 SIP/2.0"
debugLine="0"

<![CDATA[INVITE sip:600@192.168.3.18 SIP/2.0

Call-ID: d6e12283021906af516b4d9318a90fc1@192.168.3.44

CSeq: 2 INVITE

To: <sip:600@192.168.3.18>

Via: SIP/2.0/UDP 192.168.3.44:5060;branch=z9hG4bK9ccdda05565c85c31ef1f27980f342f9

Max-Forwards: 70

Contact: "Ben Asselstine" <sip:192.168.3.44:5060;transport=udp>

Content-Type: application/sdp

Proxy-Authorization: Digest username="ben",realm="asterisk",nonce="40c531b4",uri="sip:600@192.168.3.18",response="c0bba5ef8fdb04e465b135fba09b072c"

From: "Ben Asselstine"

<sip:ben@itchy.xxxxxx.yyy.zzz:5060;transport=udp>;tag=22162914

Content-Length: 153

v=0

o=ben 0 0 IN IP4 192.168.3.44

s=-

c=IN IP4 192.168.3.44

t=0 0

m=audio 22224 RTP/AVP 0 3 4 5 6 8 15

m=video 22222 RTP/AVP 34 26 31

a=recvonly

]]>
</message>

38141 [Thread-3] TRACE sip.CallDispatcher - [entry] findCall
38141 [Thread-3] TRACE sip.CallDispatcher - [exit] findCall
38141 [Thread-3] TRACE sip.SipManager - [exit] processResponse
<message
from="192.168.3.18:5060"
to="192.168.3.44:5060"
time="1082113903997"
isSender="false"
statusMessage="normal processing"
transactionId="z9hg4bk9ccdda05565c85c31ef1f27980f342f9"
firstLine="SIP/2.0 100 Trying"
callId="d6e12283021906af516b4d9318a90fc1@192.168.3.44"
debugLine="0"

<![CDATA[SIP/2.0 100 Trying

Via: SIP/2.0/UDP 192.168.3.44:5060;branch=z9hG4bK9ccdda05565c85c31ef1f27980f342f9

From: "Ben Asselstine"

<sip:ben@itchy.xxxxxx.yyy.zzz:5060;transport=udp>;tag=22162914

To: <sip:600@192.168.3.18>;tag=as16260d10

Call-ID: d6e12283021906af516b4d9318a90fc1@192.168.3.44

CSeq: 2 INVITE

User-Agent: Asterisk PBX

Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER

Contact: <sip:600@192.168.3.18>

Content-Length: 0

]]>
</message>

<message
from="192.168.3.18:5060"
to="192.168.3.44:5060"
time="1082113904004"
isSender="false"
statusMessage="normal processing"
transactionId="z9hg4bk9ccdda05565c85c31ef1f27980f342f9"
firstLine="SIP/2.0 200 OK"
callId="d6e12283021906af516b4d9318a90fc1@192.168.3.44"
debugLine="0"

<![CDATA[SIP/2.0 200 OK

Via: SIP/2.0/UDP 192.168.3.44:5060;branch=z9hG4bK9ccdda05565c85c31ef1f27980f342f9

From: "Ben Asselstine"

<sip:ben@itchy.xxxxxx.yyy.zzz:5060;transport=udp>;tag=22162914

To: <sip:600@192.168.3.18>;tag=as16260d10

Call-ID: d6e12283021906af516b4d9318a90fc1@192.168.3.44

CSeq: 2 INVITE

User-Agent: Asterisk PBX

Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER

Contact: <sip:600@192.168.3.18>

Content-Type: application/sdp

Content-Length: 207

v=0

o=root 10318 10318 IN IP4 192.168.3.18

s=session

c=IN IP4 192.168.3.18

t=0 0

m=audio 11382 RTP/AVP 3 0 8

a=rtpmap:3 GSM/8000

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=silenceSupp:off - - - -

]]>
</message>

38174 [AWT-EventQueue-0] TRACE sip.CallDispatcher - [entry] createCall
38175 [AWT-EventQueue-0] TRACE sip.CallDispatcher - [entry] findCall
38175 [AWT-EventQueue-0] TRACE sip.CallDispatcher - [exit] findCall
38176 [AWT-EventQueue-0] DEBUG sip.CallDispatcher - created call[ Call 12743356
from 600@sip:600@192.168.3.18
SDP:null]
38176 [AWT-EventQueue-0] TRACE sip.CallDispatcher - [exit] createCall
38177 [AWT-EventQueue-0] TRACE sip.Call - [entry] setState
38177 [AWT-EventQueue-0] DEBUG sip.Call - setting call status to Dialing
38179 [AWT-EventQueue-0] TRACE sip.Call - [exit] setState
38179 [AWT-EventQueue-0] TRACE sip.CallProcessing - [exit] invite
38179 [AWT-EventQueue-0] TRACE sip.SipManager - [exit] establishCall
38181 [AWT-EventQueue-0] TRACE communicator.SipCommunicator - [exit] handleDialRequest

logs for asterisk starting at the 2nd invite,
and continuing to the 1st 200 retransmittal by asterisk.
--------------------------------------------------------------
Sip read:
INVITE sip:600@192.168.3.18 SIP/2.0
Call-ID: d6e12283021906af516b4d9318a90fc1@192.168.3.44
CSeq: 2 INVITE
To: <sip:600@192.168.3.18>
Via: SIP/2.0/UDP 192.168.3.44:5060;branch=z9hG4bK9ccdda05565c85c31ef1f27980f342f9
Max-Forwards: 70
Contact: "Ben Asselstine" <sip:192.168.3.44:5060;transport=udp>
Content-Type: application/sdp
Proxy-Authorization: Digest username="ben",realm="asterisk",nonce="40c531b4",uri="sip:600@192.168.3.18",response="c0bba5ef8fdb04e465b135fba09b072c"

From: "Ben Asselstine"

<sip:ben@itchy.xxxxxx.yyy.zzz:5060;transport=udp>;tag=22162914
Content-Length: 153

v=0
o=ben 0 0 IN IP4 192.168.3.44
s=-
c=IN IP4 192.168.3.44
t=0 0
m=audio 22224 RTP/AVP 0 3 4 5 6 8 15
m=video 22222 RTP/AVP 34 26 31
a=recvonly

11 headers, 8 lines
Using latest request as basis request
Sending to 192.168.3.44 : 5060 (non-NAT)
Found audio format UNKN
Found audio format ULAW
Found audio format UNKN
Found audio format ALAW
Found audio format UNKN
Capabilities: us - 524302, them - 47/0, combined - 14
Non-codec capabilities: us - 1, them - 0, combined - 0
Looking for 600 in default
list_route: hop: <sip:192.168.3.44:5060;transport=udp>
Transmitting (no NAT):
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.3.44:5060;branch=z9hG4bK9ccdda05565c85c31ef1f27980f342f9

From: "Ben Asselstine"

<sip:ben@itchy.xxxxxx.yyy.zzz:5060;transport=udp>;tag=22162914
To: <sip:600@192.168.3.18>;tag=as16260d10
Call-ID: d6e12283021906af516b4d9318a90fc1@192.168.3.44
CSeq: 2 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:600@192.168.3.18>
Content-Length: 0

to 192.168.3.44:5060
    -- Executing Playback("SIP/ben-c20e", "demo-echotest") in new stack
We're at 192.168.3.18 port 11382
Answering/Requesting with preferred capability 2
Answering with capability 4
Answering with capability 8
Reliably Transmitting (no NAT):
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.3.44:5060;branch=z9hG4bK9ccdda05565c85c31ef1f27980f342f9

From: "Ben Asselstine"

<sip:ben@itchy.xxxxxx.yyy.zzz:5060;transport=udp>;tag=22162914
To: <sip:600@192.168.3.18>;tag=as16260d10
Call-ID: d6e12283021906af516b4d9318a90fc1@192.168.3.44
CSeq: 2 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:600@192.168.3.18>
Content-Type: application/sdp
Content-Length: 207

v=0
o=root 10318 10318 IN IP4 192.168.3.18
s=session
c=IN IP4 192.168.3.18
t=0 0
m=audio 11382 RTP/AVP 3 0 8
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=silenceSupp:off - - - -

to 192.168.3.44:5060
    -- Playing 'demo-echotest' (language 'en')
Retransmitting #1 (no NAT):
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.3.44:5060;branch=z9hG4bK9ccdda05565c85c31ef1f27980f342f9

From: "Ben Asselstine"

<sip:ben@itchy.xxxxxx.yyy.zzz:5060;transport=udp>;tag=22162914
To: <sip:600@192.168.3.18>;tag=as16260d10
Call-ID: d6e12283021906af516b4d9318a90fc1@192.168.3.44
CSeq: 2 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:600@192.168.3.18>
Content-Type: application/sdp
Content-Length: 207

v=0
o=root 10318 10318 IN IP4 192.168.3.18
s=session
c=IN IP4 192.168.3.18
t=0 0
m=audio 11382 RTP/AVP 3 0 8
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=silenceSupp:off - - - -
" <
to 192.168.3.44:5060
Retransmitting #2 (no NAT):
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.3.44:5060;branch=z9hG4bK9ccdda05565c85c31ef1f27980f342f9

From: "Ben Asselstine"

<sip:ben@itchy.xxxxxx.yyy.zzz:5060;transport=udp>;tag=22162914
To: <sip:600@192.168.3.18>;tag=as16260d10
Call-ID: d6e12283021906af516b4d9318a90fc1@192.168.3.44
CSeq: 2 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:600@192.168.3.18>
Content-Type: application/sdp
Content-Length: 207

v=0
o=root 10318 10318 IN IP4 192.168.3.18
s=session
c=IN IP4 192.168.3.18
t=0 0
m=audio 11382 RTP/AVP 3 0 8
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=silenceSupp:off - - - -
" <
to 192.168.3.44:5060

thanks,

Ben

[1] http://sip-communicator.dev.java.net/
[2] http://www.asterisk.org

_________________________________________________________________
STOP MORE SPAM with the MSN Premium and get 2 months FREE* http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net