[asterisk-dev] Asterisk INVITE request problems

Josep Benavent josep.benavent at gmail.com
Fri Jan 29 06:50:40 CST 2010


Hello!

I'm trying to connect my application to Asterisk using a proxy SER
with JAIN-SIP libraries and I'm getting problems when I  send an
invite process.

The dialogue I implement is detailed following:

--> Send REGISTER
<-- Receive 100 Trying
<-- Receive 401 Unautorized
--> Resend REGISTER with  Authorization header (in response of 401 Nonce)
<-- Receive 100 Trying
<-- Receive 200 OK
--> Send INVITE (1)
<-- Receive 407 Proxy Authentication Required (2)
--> Send 200 OK (3)
--> Resend INVITE with Proxy-Authentication header (in response of 403
Nonce) (4)
<-- Receive 407 Proxy Authentication Required (5)


The problem I have is I never can obtain a correct response to the
INVITE (the authenticate invite, which includes the response value of
the 407 response); I can't complete the INVITE dialogue
successfully....

For more information, I detail my packets following:

(1)
INVITE sip:josep.benavent at i2cat.net SIP/2.0
Call-ID: 3ff731b4a26ab789131d35e857f1b547 at 192.168.48.127
CSeq: 1 INVITE
From: <sip:josep.benavent at i2cat.net>;tag=123456789
To: <sip:josep.benavent at i2cat.net>
Via: SIP/2.0/UDP
192.168.48.127:12355;branch=z9hG4bK72df4bf172c56418ca9563cf02ee9676
Max-Forwards: 70
Contact: <sip:josep.benavent at 192.168.48.127:12355;transport=TCP>
User-Agent: i2cat Xpress Call
Content-Type: application/sdp
Content-Length: 193
v=0
o=4855 13760799956958020 13760799956958020 IN IP4  192.68.48.172
s=mysession session
p=+46 8 52018010
c=IN IP4  192.68.48.172
t=0 0
m=audio 6022 RTP/AVP 0 4 18
a=rtpmap:0 PCMU/8000

-------------------------------------------
(2)
SIP/2.0 407 Proxy Authentication Required
Call-ID: 3ff731b4a26ab789131d35e857f1b547 at 192.168.48.127
CSeq: 1 INVITE
From: <sip:josep.benavent at i2cat.net>;tag=123456789
To: <sip:josep.benavent at i2cat.net>;tag=f66c2a1d7e7c524112e7d38863ab16c6.27df
Via: SIP/2.0/UDP
192.168.48.127:12355;branch=z9hG4bK72df4bf172c56418ca9563cf02ee9676;received=84.88.32.2
Proxy-Authenticate: Digest realm="i2cat.net",
nonce="4b62d13882b2f61033d61d250acf2a6ad1fc3263"
Server: Sip EXpress router (0.9.7+cvs20080328 (i386/linux))
Content-Length: 0
Warning: 392 84.88.32.46:5060 "Noisy feedback tells:  pid=583
req_src_ip=84.88.32.2 req_src_port=12355
in_uri=sip:josep.benavent at i2cat.net
out_uri=sip:josep.benavent at i2cat.net via_cnt==1"

-------------------------
(3)
ACK sip:josep.benavent at i2cat.net SIP/2.0
Call-ID: 3ff731b4a26ab789131d35e857f1b547 at 192.168.48.127
CSeq: 1 ACK
From: <sip:josep.benavent at i2cat.net>;tag=123456789
To: <sip:josep.benavent at i2cat.net>;tag=f66c2a1d7e7c524112e7d38863ab16c6.27df
Via: SIP/2.0/UDP
192.168.48.127:12355;branch=z9hG4bK72df4bf172c56418ca9563cf02ee9676
Max-Forwards: 70
User-Agent: i2cat Xpress Call
Content-Length: 0
------------------------------
(4)
INVITE sip:xavier.calvo at i2cat.net SIP/2.0
Call-ID: 3ff731b4a26ab789131d35e857f1b547 at 192.168.48.127
CSeq: 2 INVITE
From: <sip:josep.benavent at i2cat.net>;tag=123456789
To: <sip:xavier.calvo at i2cat.net>
Via: SIP/2.0/UDP
192.168.48.127:12355;branch=z9hG4bKe8c7f79884a46c10dbc4379b78ca3207
Max-Forwards: 70
Contact: <sip:josep.benavent at 192.168.48.127:12355;transport=TCP>
Proxy-Authorization: Digest
username="josep.benavent",realm="i2cat.net",nonce="4b62d13882b2f61033d61d250acf2a6ad1fc3263",uri="sip:xavier.calvo at i2cat.net",response="e68523e0040d195ff951704dc0a6dd30",algorithm=MD5
User-Agent: i2cat Xpress Call
Content-Type: application/sdp
Content-Length: 140
v=0
o=- 2 IN IP4 192.168.48.127
s=XpressCall now
c=IN IP4 192.68.48.127
t=0 0
m=audio 46006 RTP/AVP 107 0 8 101
a=rtpmap:0 PCMU/8000
----------------------------------------------
(5)
SIP/2.0 407 Proxy Authentication Required
Call-ID: 3ff731b4a26ab789131d35e857f1b547 at 192.168.48.127
CSeq: 2 INVITE
From: <sip:josep.benavent at i2cat.net>;tag=123456789
To: <sip:xavier.calvo at i2cat.net>;tag=f66c2a1d7e7c524112e7d38863ab16c6.34f1
Via: SIP/2.0/UDP
192.168.48.127:12355;branch=z9hG4bKe8c7f79884a46c10dbc4379b78ca3207;received=84.88.32.2
Proxy-Authenticate: Digest realm="i2cat.net",
nonce="4b62d13882b2f61033d61d250acf2a6ad1fc3263"
Server: Sip EXpress router (0.9.7+cvs20080328 (i386/linux))
Content-Length: 0
Warning: 392 84.88.32.46:5060 "Noisy feedback tells:  pid=571
req_src_ip=84.88.32.2 req_src_port=12355
in_uri=sip:xavier.calvo at i2cat.net out_uri=sip:xavier.calvo at i2cat.net
via_cnt==1"


I think my problem is in the calculate Digest function (perhaps the
fields I specified to calculate that Digest are wrong???, not the
function itself, because it works in the INVITE authentication).

Any suggestion or idea will be appreciated.

Thank you for your attention,

Josep Benavent



More information about the asterisk-dev mailing list