]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Allow SIP pvts involved in Replaces transfers to fall out of reference sooner
authorKinsey Moore <kmoore@digium.com>
Fri, 27 Apr 2012 18:58:34 +0000 (18:58 +0000)
committerKinsey Moore <kmoore@digium.com>
Fri, 27 Apr 2012 18:58:34 +0000 (18:58 +0000)
Unref the SIP pvt stored in the refer structure as soon as it is no longer
needed so that the pvt and associated file descriptors can be freed sooner.
This change makes a reference decrement unnecessary in code that handles SIP
BYE/Also transfers which should not touch the reference anyway.

(Closes issue ASTERISK-19579)
Reported by: Maciej Krajewski
Tested by: Maciej Krajewski
........

Merged revisions 364258 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@364259 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 64d52720ab89f93a4a295a0d9161db2a03bb2834..1d218e1855ae94cb598733141c92e4dc7f99c6f4 100644 (file)
@@ -16207,7 +16207,6 @@ static int get_also_info(struct sip_pvt *p, struct sip_request *oreq)
                ast_copy_string(referdata->refer_to, c, sizeof(referdata->refer_to));
                ast_copy_string(referdata->referred_by, "", sizeof(referdata->referred_by));
                ast_copy_string(referdata->refer_contact, "", sizeof(referdata->refer_contact));
-               referdata->refer_call = dialog_unref(referdata->refer_call, "unreffing referdata->refer_call");
                /* Set new context */
                ast_string_field_set(p, context, transfer_context);
                return 0;
@@ -23734,6 +23733,7 @@ request_invite_cleanup:
                if (p->refer->refer_call->owner) {
                        ast_channel_unlock(p->refer->refer_call->owner);
                }
+               p->refer->refer_call = dialog_unref(p->refer->refer_call, "unref dialog p->refer->refer_call");
        }
        if (authpeer) {
                authpeer = sip_unref_peer(authpeer, "sip_unref_peer, from handle_request_invite authpeer");