summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2015-01-27 19:21:08 +0000
committerKevin Harwell <kharwell@digium.com>2015-01-27 19:21:08 +0000
commite2b493b8f0d04b5f881cf748001c3ef4b272d53a (patch)
tree11ba5b4dc309b06127972a1dce695f513f725fb4 /channels
parent9e3d316dd13970370f76e7e19982c8f571f3290b (diff)
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/ ........ Merged revisions 431187 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 6dd44c2d7..a0771edae 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -9224,7 +9224,8 @@ static struct sip_pvt *find_call(struct sip_request *req, struct ast_sockaddr *a
}
}
- 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,
};