diff options
author | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-01-15 18:22:49 +0000 |
---|---|---|
committer | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-01-15 18:22:49 +0000 |
commit | b8e9680fb0a580d9d4fe8a31769bbf9518775ebc (patch) | |
tree | 5bded0f5f8fef11fafff84e5d2a93d0f5e44be80 /res | |
parent | 9173a6fd2feb921a4948cf96c2e6b4b51ab3222d (diff) |
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: http://svn.digium.com/svn/asterisk/branches/1.4@168716 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_features.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/res/res_features.c b/res/res_features.c index e476676f4..aaa1ff593 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -176,8 +176,6 @@ struct ast_bridge_thread_obj struct ast_channel *peer; }; - - /*! \brief store context, priority and extension */ static void set_c_e_p(struct ast_channel *chan, const char *context, const char *ext, int pri) { @@ -512,6 +510,10 @@ static int masq_park_call(struct ast_channel *rchan, struct ast_channel *peer, i ast_frfree(f); } + if (peer == rchan) { + peer = chan; + } + if (!play_announcement) { orig_chan_name = ast_strdupa(chan->name); } @@ -1927,6 +1929,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|30|%s", peername, dialfeatures->options); else /* Existing default */ @@ -2059,7 +2065,6 @@ 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; @@ -2084,11 +2089,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); /* In experiments, using the masq_park_call - func here yielded no difference with - current implementation. I saw no advantage - in calling it instead. - */ + 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)); |