Daniel,

I had posted this question earlier on asterisk-users, but didn't
receive any reply, so I'm posting on sr-users in the hope that someone
can provide guidance on how to debug this problem.

Our setup involves a Sip softphone registering with a fresh install of
Asterisk v1.6.0.5 through an outbound proxy (Kamailio v3.1.1).

We observe that about 80% of the time, immediately after startup of the
softphone, when the softphone sends a REGISTER message, Asterisk
replies with a "500 Server error". However, subsequent REGISTER
messages are replied to appropriately (with a 401 Unauthorized).

you should set sip debug on for asterisk in order to get more verbose
output related to the 503 case. I couldn't spot something wrong for
register that got 503. Next ones have two contact headers, but that is
fine in SIP.

Cheers,
Daniel

I have recently had the chance to do some more debug and here is more information. It appears that the 500 Server Error is generated by Asterisk as a response to an offending REGISTER request from the softphone that has an invalid CSeq number. I have attached an excerpt of a sip trace that shows these messages. The offending REGISTER message has a CSeq that is lower than that of the earlier REGISTER message with the same Call-ID.

My questions are

1) Is the response from Asterisk (500 Server Error) valid ? Wouldn't a 4xx Client Failure response be more appropriate ?

2)The source of this error would probably be a bug in the SIP stack of the soft phone (PJSIP), correct ?

Thanks and Regards,
Vikram.
<--- SIP read from Proxy_IP:7160 --->
REGISTER sip:Asterisk_IP:5060 SIP/2.0
Via: SIP/2.0/UDP Proxy_IP:7160;branch=z9hG4bK15ba.4a1b59a5.0
Via: SIP/2.0/UDP 
UA_IP:55002;rport=55002;branch=z9hG4bKPjLCJ7hIuLN7GZhdCBLmTIdv05eRNc9k1z
Route: <sip:Proxy_IP:7160;lr>
Max-Forwards: 69
From: "44551" <sip:44551@Asterisk_IP>;tag=u-SuZXAMq2YToNldiXm9WqE9Kl4kKW9E
To: "44551" <sip:44551@Asterisk_IP>
Call-ID: 1o-UnqLhb-j4dSzDzHThXhF0uE-nQu4Z
CSeq: 34469 REGISTER
Contact: <sip:44551@UA_IP:55002;transport=UDP>
Expires: 0
Authorization: Digest username="44551", realm="asterisk", nonce="7d7384ce", 
uri="sip:Asterisk_IP:5060", response="c25d68ef6443de1145b5969f6614fcb7", 
algorithm=MD5
Content-Length:  0
P-hint: outbound


<--- Transmitting (NAT) to Proxy_IP:7160 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP Proxy_IP:7160;branch=z9hG4bK15ba.4a1b59a5.0;received=Proxy_IP
Via: SIP/2.0/UDP 
UA_IP:55002;rport=55002;branch=z9hG4bKPjLCJ7hIuLN7GZhdCBLmTIdv05eRNc9k1z
From: "44551" <sip:44551@Asterisk_IP>;tag=u-SuZXAMq2YToNldiXm9WqE9Kl4kKW9E
To: "44551" <sip:44551@Asterisk_IP>
Call-ID: 1o-UnqLhb-j4dSzDzHThXhF0uE-nQu4Z
CSeq: 34469 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Length: 0


<--- Transmitting (NAT) to Proxy_IP:7160 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP Proxy_IP:7160;branch=z9hG4bK15ba.4a1b59a5.0;received=Proxy_IP
Via: SIP/2.0/UDP 
UA_IP:55002;rport=55002;branch=z9hG4bKPjLCJ7hIuLN7GZhdCBLmTIdv05eRNc9k1z
From: "44551" <sip:44551@Asterisk_IP>;tag=u-SuZXAMq2YToNldiXm9WqE9Kl4kKW9E
To: "44551" <sip:44551@Asterisk_IP>;tag=as08b92022
Call-ID: 1o-UnqLhb-j4dSzDzHThXhF0uE-nQu4Z
CSeq: 34469 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Expires: 0
Date: Fri, 04 Feb 2011 22:11:57 GMT
Content-Length: 0


<--- SIP read from Proxy_IP:7160 --->                         
REGISTER sip:Asterisk_IP:5060 SIP/2.0
Via: SIP/2.0/UDP Proxy_IP:7160;branch=z9hG4bK54ba.9714d2e6.0
Via: SIP/2.0/UDP 
192.168.1.2:7160;received=UA_IP;rport=55002;branch=z9hG4bKPju8xsdcZ1vD7-ykHX33rq78nBeEJ3k-eP
Route: <sip:Proxy_IP:7160;lr>
Max-Forwards: 69
From: "44551" <sip:44551@Asterisk_IP>;tag=fCMU.J88N4jATP5d3d6zjXPbFyWAbz6Q
To: "44551" <sip:44551@Asterisk_IP>
Call-ID: 1o-UnqLhb-j4dSzDzHThXhF0uE-nQu4Z                                       
                  **************************************************************
CSeq: 34464 REGISTER                                                            
                  **************** OFFENDING REGISTER MESSAGE ******************
Contact: "44551" <sip:44551@192.168.1.2:7160>                                   
                  ****************   CSeq number is < 34469   ******************
Expires: 300                                                                    
                  ****************    Call-ID is the same     
****************** 
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, 
MESSAGE, OPTIONS        
**************************************************************
Content-Length:  0
P-hint: outbound


<--- Transmitting (NAT) to Proxy_IP:7160 --->
SIP/2.0 500 Server error
Via: SIP/2.0/UDP Proxy_IP:7160;branch=z9hG4bK54ba.9714d2e6.0;received=Proxy_IP
Via: SIP/2.0/UDP 
192.168.1.2:7160;received=UA_IP;rport=55002;branch=z9hG4bKPju8xsdcZ1vD7-ykHX33rq78nBeEJ3k-eP
From: "44551" <sip:44551@Asterisk_IP>;tag=fCMU.J88N4jATP5d3d6zjXPbFyWAbz6Q
To: "44551" <sip:44551@Asterisk_IP>;tag=as08b92022
Call-ID: 1o-UnqLhb-j4dSzDzHThXhF0uE-nQu4Z
CSeq: 34464 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Length: 0


<--- SIP read from Proxy_IP:7160 --->
REGISTER sip:Asterisk_IP:5060 SIP/2.0
Via: SIP/2.0/UDP Proxy_IP:7160;branch=z9hG4bK4d68.9f244f91.0
Via: SIP/2.0/UDP 
192.168.1.2:7160;received=UA_IP;rport=55002;branch=z9hG4bKPjTxWqFoP7fl2s1ZB8O.4wLyLKmEnW.2uX
Route: <sip:Proxy_IP:7160;lr>
Max-Forwards: 69
From: "44551" <sip:44551@Asterisk_IP>;tag=9ZoibFKLQySD6Qop2y.CgFNJshsdHlSf
To: "44551" <sip:44551@Asterisk_IP>
Call-ID: L27qeLd87ekVYu6VDUiJsG4iRAHTiBFP
CSeq: 61365 REGISTER
Contact: "44551" <sip:44551@192.168.1.2:7160>
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, 
MESSAGE, OPTIONS
Content-Length:  0
P-hint: outbound


<--- Transmitting (NAT) to Proxy_IP:7160 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP Proxy_IP:7160;branch=z9hG4bK4d68.9f244f91.0;received=Proxy_IP
Via: SIP/2.0/UDP 
192.168.1.2:7160;received=UA_IP;rport=55002;branch=z9hG4bKPjTxWqFoP7fl2s1ZB8O.4wLyLKmEnW.2uX
From: "44551" <sip:44551@Asterisk_IP>;tag=9ZoibFKLQySD6Qop2y.CgFNJshsdHlSf
To: "44551" <sip:44551@Asterisk_IP>
Call-ID: L27qeLd87ekVYu6VDUiJsG4iRAHTiBFP
CSeq: 61365 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Length: 0


<--- Transmitting (NAT) to Proxy_IP:7160 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP Proxy_IP:7160;branch=z9hG4bK4d68.9f244f91.0;received=Proxy_IP
Via: SIP/2.0/UDP 
192.168.1.2:7160;received=UA_IP;rport=55002;branch=z9hG4bKPjTxWqFoP7fl2s1ZB8O.4wLyLKmEnW.2uX
From: "44551" <sip:44551@Asterisk_IP>;tag=9ZoibFKLQySD6Qop2y.CgFNJshsdHlSf
To: "44551" <sip:44551@Asterisk_IP>;tag=as21d4277c
Call-ID: L27qeLd87ekVYu6VDUiJsG4iRAHTiBFP
CSeq: 61365 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="4de61460"
Content-Length: 0
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to