]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Honor configured parkinglot when parking and retrieving parked calls
authorMichiel van Baak <michiel@vanbaak.info>
Wed, 2 Sep 2009 15:56:46 +0000 (15:56 +0000)
committerMichiel van Baak <michiel@vanbaak.info>
Wed, 2 Sep 2009 15:56:46 +0000 (15:56 +0000)
Thank oej for pointing out the fact that sip_new did not copy parkinglot from the peer
into the newly created channel.

(closes issue #15538)
Reported by: gracedman
Patches:
      2009090100_sipnewparkinglot-161.diff.txt uploaded by mvanbaak (license 7)
  With mod by me to also fix callparking as well (this uploaded patch only fixed retrieving a parked call)
Tested by: gracedman, mvanbaak

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

channels/chan_sip.c

index fc963d3baa05031f277e86a6385eba99f1ac8c93..c803fc65451106bf89c542416459a9e960a18478 100644 (file)
@@ -6676,6 +6676,8 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
        tmp->callgroup = i->callgroup;
        tmp->pickupgroup = i->pickupgroup;
        tmp->cid.cid_pres = i->callingpres;
+       if (!ast_strlen_zero(i->parkinglot))
+               ast_string_field_set(tmp, parkinglot, i->parkinglot);
        if (!ast_strlen_zero(i->accountcode))
                ast_string_field_set(tmp, accountcode, i->accountcode);
        if (i->amaflags)
@@ -19173,6 +19175,8 @@ static int sip_park(struct ast_channel *chan1, struct ast_channel *chan2, struct
        /* Make formats okay */
        transferer->readformat = chan2->readformat;
        transferer->writeformat = chan2->writeformat;
+       if (!ast_strlen_zero(chan2->parkinglot))
+               ast_string_field_set(transferer, parkinglot, chan2->parkinglot);
 
        /* Prepare for taking over the channel.  Go ahead and grab this channel
         * lock here to avoid a deadlock with callbacks into the channel driver