]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 168941 via svnmerge from
authorTerry Wilson <twilson@digium.com>
Fri, 16 Jan 2009 22:52:03 +0000 (22:52 +0000)
committerTerry Wilson <twilson@digium.com>
Fri, 16 Jan 2009 22:52:03 +0000 (22:52 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r168941 | twilson | 2009-01-16 16:16:23 -0600 (Fri, 16 Jan 2009) | 19 lines

  Merged revisions 168716 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r168716 | twilson | 2009-01-15 12:22:49 -0600 (Thu, 15 Jan 2009) | 12 lines

    Convert call to park_call_full to masq_park_call_announce

    Since we removed the AST_PBX_KEEPALIVE return value, we need to use masqueraded
    parking, otherwise we will try to call ast_hangup() in __pbx_run() and in
    do_parking_thread() and then promptly crash.
    (closes issue #14215)
     Reported by: waverly360
     Tested by: otherwiseguy
    (closes issue #14228)
     Reported by: kobaz
     Tested by: otherwiseguy
  ........
................

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

main/features.c

index 4a1244c8ae907efefc2e981a144ac74b503d6c95..0822f9d15c864a7cd5945cf325a285adcf7a4a7a 100644 (file)
@@ -548,6 +548,10 @@ static int masq_park_call(struct ast_channel *rchan, struct ast_channel *peer, i
        if ((f = ast_read(chan)))
                ast_frfree(f);
 
+       if (peer == rchan) {
+               peer = chan;
+       }
+
        if (!play_announcement) {
                orig_chan_name = ast_strdupa(chan->name);
        }
@@ -2415,6 +2419,10 @@ static void *do_parking_thread(void *ignore)
 
                                                ast_channel_unlock(chan);
 
+                                               if (!strncmp(peername, "Parked/", 7)) {
+                                                       peername += 7;
+                                               }
+
                                                if (dialfeatures)
                                                        snprintf(returnexten, sizeof(returnexten), "%s,,%s", peername, dialfeatures->options);
                                                else /* Existing default */
@@ -2536,10 +2544,6 @@ std:                                     for (x=0; x<AST_MAX_FDS; x++) { /* mark fds for next round */
 /*! \brief Park a call */
 static int park_call_exec(struct ast_channel *chan, void *data)
 {
-       /* Cache the original channel name in case we get masqueraded in the middle
-        * of a park--it is still theoretically possible for a transfer to happen before
-        * we get here, but it is _really_ unlikely */
-       char *orig_chan_name = ast_strdupa(chan->name);
        char orig_exten[AST_MAX_EXTENSION];
        int orig_priority = chan->priority;
 
@@ -2561,7 +2565,7 @@ static int park_call_exec(struct ast_channel *chan, void *data)
                res = ast_safe_sleep(chan, 1000);
        /* Park the call */
        if (!res) {
-               res = park_call_full(chan, chan, 0, NULL, orig_chan_name);
+               res = masq_park_call_announce(chan, chan, 0, NULL);
                /* Continue on in the dialplan */
                if (res == 1) {
                        ast_copy_string(chan->exten, orig_exten, sizeof(chan->exten));