[asterisk-dev] [Code Review] 4367: chan_sip: stale nonce causes failure
Kevin Harwell
reviewboard at asterisk.org
Mon Jan 26 11:17:42 CST 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4367/
-----------------------------------------------------------
(Updated Jan. 26, 2015, 11:17 a.m.)
Review request for Asterisk Developers.
Changes
-------
Updated based on feedback/conversation with Mark. This new fix reuses the old "dialog" if it still exists. It does this by matching only on the callid for registers (before it was matching callid && from tag).
Bugs: ASTERISK-24715
https://issues.asterisk.org/jira/browse/ASTERISK-24715
Repository: Asterisk
Description
-------
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 then the from tag is always checked thus allowing the correct "dialog" to be selected.
Diffs (updated)
-----
branches/11/channels/chan_sip.c 431112
Diff: https://reviewboard.asterisk.org/r/4367/diff/
Testing
-------
Setup two asterisk systems, one to register and one to accept registers. Specified a small expiration in the configuration file and then watched as the primary system registered successfully to the secondary system. Then upon refresh saw the notice message and received a registration rejection message. Applied the fix and the problem no longer occurred.
Thanks,
Kevin Harwell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150126/13d0958a/attachment.html>
More information about the asterisk-dev
mailing list