diff options
author | Mark Michelson <mmichelson@digium.com> | 2015-06-12 16:02:25 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2015-06-12 16:02:25 -0500 |
commit | 2618d1e6380659441c3ab5c94a8cdd2f26c53f49 (patch) | |
tree | 703dff9edcfd66a4c79008d5f028dce8a2195c7c /channels | |
parent | 0b233ea61d6ee7b5ef4aa74ad7cd847107c0cccb (diff) | |
parent | 3f57f3f8ec63752ccd1d87d7c6737f64043cb8a9 (diff) |
Merge "chan_sip.c: Update dialog fromtag after request with auth" into 13
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 5be0200ed..ff0067dcd 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -9240,6 +9240,15 @@ static struct sip_pvt *__find_call(struct sip_request *req, struct ast_sockaddr switch (found) { case SIP_REQ_MATCH: + sip_pvt_lock(sip_pvt_ptr); + if (args.method != SIP_RESPONSE && args.authentication_present + && strcmp(args.fromtag, sip_pvt_ptr->theirtag)) { + /* If we have a request that uses athentication and the fromtag is + * different from that in the original call dialog, update the + * fromtag in the saved call dialog */ + ast_string_field_set(sip_pvt_ptr, theirtag, args.fromtag); + } + sip_pvt_unlock(sip_pvt_ptr); ao2_iterator_destroy(iterator); dialog_unref(fork_pvt, "unref fork_pvt"); free_via(via); |