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
This commit is contained in:
Mark Spencer
2004-03-24 05:01:44 +00:00
parent 4f72330f5c
commit 61d1fd9a0e
2 changed files with 38 additions and 7 deletions

9
pbx.c
View File

@@ -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);