From: Tilghman Lesher Date: Fri, 30 May 2008 16:40:13 +0000 (+0000) Subject: Suppress warning about pbx structure already existing X-Git-Tag: 1.6.2.0-beta1~2116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=428f08bd64832d331011a608a4d8dc8c8e34f46f;p=thirdparty%2Fasterisk.git Suppress warning about pbx structure already existing git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119299 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_stack.c b/apps/app_stack.c index 7131a8d3cc..b0f703bb60 100644 --- a/apps/app_stack.c +++ b/apps/app_stack.c @@ -451,9 +451,16 @@ static int handle_gosub(struct ast_channel *chan, AGI *agi, int argc, char **arg chan->priority = 0; if ((res = pbx_exec(chan, theapp, gosub_args)) == 0) { + struct ast_pbx *pbx = chan->pbx; + /* Suppress warning about PBX already existing */ + chan->pbx = NULL; ast_agi_fdprintf(chan, agi->fd, "100 result=0 Trying...\n"); ast_pbx_run(chan); ast_agi_fdprintf(chan, agi->fd, "200 result=0 Gosub complete\n"); + if (chan->pbx) { + ast_free(chan->pbx); + } + chan->pbx = pbx; } else { ast_agi_fdprintf(chan, agi->fd, "200 result=%d Gosub failed\n", res); }