summaryrefslogtreecommitdiff
path: root/pbx.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-03-24 05:01:44 +0000
committerMark Spencer <markster@digium.com>2004-03-24 05:01:44 +0000
commit61d1fd9a0e23f99b7bc68bfc0f0919ac85e5c6cb (patch)
tree0c87372e07e810b58715fbc7dbe10e8f91831ab0 /pbx.c
parent4f72330f5c33f005942106d62164cb7ee8eaca2c (diff)
Make FAX enableable/disablabable, fix async goto support properly
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2544 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'pbx.c')
-rwxr-xr-xpbx.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/pbx.c b/pbx.c
index f033de974..b837af4f0 100755
--- a/pbx.c
+++ b/pbx.c
@@ -3519,7 +3519,6 @@ int ast_async_goto(struct ast_channel *chan, char *context, char *exten, int pri
the PBX, we have to make a new channel, masquerade, and start the PBX
at the new location */
struct ast_channel *tmpchan;
- struct ast_frame *f;
tmpchan = ast_channel_alloc(0);
if (tmpchan) {
snprintf(tmpchan->name, sizeof(tmpchan->name), "AsyncGoto/%s", chan->name);
@@ -3547,10 +3546,10 @@ int ast_async_goto(struct ast_channel *chan, char *context, char *exten, int pri
if (needlock)
ast_mutex_unlock(&chan->lock);
- /* Make the masquerade happen by reading a frame from the tmp channel */
- f = ast_read(tmpchan);
- if (f)
- ast_frfree(f);
+ /* Grab the locks and get going */
+ ast_mutex_lock(&tmpchan->lock);
+ ast_do_masquerade(tmpchan, 0);
+ ast_mutex_unlock(&tmpchan->lock);
/* Start the PBX going on our stolen channel */
if (ast_pbx_start(tmpchan)) {
ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmpchan->name);