[svn-commits] kharwell: branch 11 r431187 - /branches/11/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jan 27 13:19:29 CST 2015


Author: kharwell
Date: Tue Jan 27 13:19:25 2015
New Revision: 431187

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=431187
Log:
chan_sip: stale nonce causes failure

When refreshing (with a small expiration) a registration that was sent to
chan_sip the nonce would be considered stale and reject the registration.
What was happening was that the initial registration's "dialog" still existed
in the dialogs container and upon refresh the dialog match algorithm would
choose that as the "dialog" instead of the newly created one. This occurred
because the algorithm did not check to see if the from tag matched if
authentication info was available after the 401. So, it ended up assuming
the original "dialog" was a match and stopped the search. The old "dialog"
of course had an old nonce, thus the stale nonce message.

This fix attempts to leave the original functionality alone except in the case
of a REGISTER. If a REGISTER is received if searches for an existing "dialog"
matching only on the callid. If the expires value is low enough it will reuse
dialog that is there, otherwise it will create a new one.

ASTERISK-24715 #close
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/4367/

Modified:
    branches/11/channels/chan_sip.c

Modified: branches/11/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/chan_sip.c?view=diff&rev=431187&r1=431186&r2=431187
==============================================================================
--- branches/11/channels/chan_sip.c (original)
+++ branches/11/channels/chan_sip.c Tue Jan 27 13:19:25 2015
@@ -9047,7 +9047,8 @@
 		}
 	}
 
-	if (!sip_cfg.pedanticsipchecking) {
+	/* match on callid only for REGISTERs */
+	if (!sip_cfg.pedanticsipchecking || req->method == SIP_REGISTER) {
 		struct sip_pvt tmp_dialog = {
 			.callid = callid,
 		};




More information about the svn-commits mailing list