Summary:ASTERISK-05146: [patch] SIP RFC minor issue
Reporter:wlloyd (wlloyd)Labels:
Date Opened:2005-09-25 14:20:04Date Closed:2011-06-07 14:10:27
Versions:Frequency of
Environment:Attachments:( 0) babytel.txt
( 1) contact_uri_patch.txt
( 2) jasomi.log
( 3) messages
( 4) messages.24
Description:This issue came up in interoperability with a Jasomi SBC and CVS HEAD.

Asterisk send INVITE
Jasomi replies TRYING
Jasomi send 407 Proxy Auth

In the 407 message the Jasomi sends something that is NOT an URI in the Contact header line.  It's an error message.  

Asterisk is calling extract_uri to replace the URI for the next invite with the Contact URI from the 407 reponse.  Except it's not really a valid URI.  It's an error message so the next INVITE is garbage.

I've been reading RFC 3261 and Jasomi seems to be doing something that is allowed.

The contact URI is only followed on 3XX reponses not for everything.

In the case of 3XX reponses Asterisk was already using parse_moved_contact to rewite the URI.

Basically just seems to be an extra line.  Asterisk 1.0.x didn;t follow the Contact on a 407 so this reverts HEAD back to Asterisk 1.0.x and I think RFC expected behavior.

Hoping to get this into 1.2.  While 1.0.x works with my provider CVS HEAD currently does not due to this bug.

Comments:By: Mark Spencer (markster) 2005-09-25 15:08:48

Can you please supply a sample sip debug of such a session?

By: wlloyd (wlloyd) 2005-09-27 09:22:19

sip debug logs sent directly to markster

By: Serge Vecher (serge-v) 2005-09-27 10:24:13

bill, can you please attach sip debug to the bug as well, so somebody else (oej maybe) has a chance to look at this? Thanks

By: wlloyd (wlloyd) 2005-09-28 13:06:15

Log file for a session.

The non valid Contact uri looks something like...
Contact: <sip:hQ9-L-101454101@>

By: Olle Johansson (oej) 2005-09-28 15:21:04

Please add a full SIP debug of the session as documentation. Thank you.

By: wlloyd (wlloyd) 2005-10-01 14:47:01

I've added the log files.  Anybody have any insight on this issue?

By: Olle Johansson (oej) 2005-10-02 11:39:15

Please confirm that you are using the latest CVS head. You have some extra stuff in there that is not in the standard chan_sip. I can not see how a 407 can end in parse_moved_contact in chan_sip cvs head. Your diff also indicate version skew. If it is not latest cvs head, please download the latest code and try with that one.

Thank you for a fast reply.

By: Olle Johansson (oej) 2005-10-02 14:57:00

...still need a reply on exactly which version of chan_sip you are using.

By: wlloyd (wlloyd) 2005-10-02 22:26:40

Ok, new asterisk checkout from 5 min ago against CVS HEAD.
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.872 $")

Totally blew away my asterisk directory and checkout everyhting again.

Included a new debug session from the same call as before.

The previous debug session had some of my own debug headers printing.  It was purely for me to see have things were changing as the call progressed.


By: Olle Johansson (oej) 2005-10-03 02:38:19

...and in that version it does not happen, at least not in your debug. Please confirm if the problem still exists in cvs head and if it does, add debug output where it actually happens, please.

By: wlloyd (wlloyd) 2005-10-03 10:14:20

Sorry, last messages upload did not contain the debug!

Messages.24 def does.


By: Olle Johansson (oej) 2005-10-05 14:11:32

Is it possible to get access to your system to figure this out?

By: Olle Johansson (oej) 2005-10-06 01:16:30

...will get access to this system for checking...

By: Olle Johansson (oej) 2005-10-11 21:38:25

Finally confirmed in the Astricon Code Zone over beer and pizza. :-) Now, let's fix this.

By: Mark Spencer (markster) 2005-10-12 01:05:19

Fixed in CVS head.

By: Digium Subversion (svnbot) 2008-01-15 15:50:32.000-0600

Repository: asterisk
Revision: 6747

U   trunk/channels/chan_sip.c

r6747 | markster | 2008-01-15 15:50:32 -0600 (Tue, 15 Jan 2008) | 2 lines

Handle yet some SIP contact issue nuances and exceptions (bug ASTERISK-5146 with mods and rant)