mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
Add an API call (ast_async_parseable_goto) which parses a goto string and does an async goto instead of an explicit goto.
(closes issue #11753) Reported by: johan git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103765 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -72,7 +72,7 @@ static int asyncgoto_exec(struct ast_channel *chan, void *data)
|
||||
return -1;
|
||||
}
|
||||
|
||||
res = ast_parseable_goto(chan2, args.label);
|
||||
res = ast_async_parseable_goto(chan2, args.label);
|
||||
|
||||
ast_channel_unlock(chan2);
|
||||
|
||||
|
@@ -861,6 +861,11 @@ int ast_goto_if_exists(struct ast_channel *chan, const char *context, const char
|
||||
*/
|
||||
int ast_parseable_goto(struct ast_channel *chan, const char *goto_string);
|
||||
|
||||
/*!
|
||||
* \note This function will handle locking the channel as needed.
|
||||
*/
|
||||
int ast_async_parseable_goto(struct ast_channel *chan, const char *goto_string);
|
||||
|
||||
/*!
|
||||
* \note This function will handle locking the channel as needed.
|
||||
*/
|
||||
|
18
main/pbx.c
18
main/pbx.c
@@ -7792,7 +7792,7 @@ int ast_async_goto_if_exists(struct ast_channel *chan, const char * context, con
|
||||
return __ast_goto_if_exists(chan, context, exten, priority, 1);
|
||||
}
|
||||
|
||||
int ast_parseable_goto(struct ast_channel *chan, const char *goto_string)
|
||||
static int pbx_parseable_goto(struct ast_channel *chan, const char *goto_string, int async)
|
||||
{
|
||||
char *exten, *pri, *context;
|
||||
char *stringp;
|
||||
@@ -7836,8 +7836,22 @@ int ast_parseable_goto(struct ast_channel *chan, const char *goto_string)
|
||||
if (mode)
|
||||
ipri = chan->priority + (ipri * mode);
|
||||
|
||||
ast_explicit_goto(chan, context, exten, ipri);
|
||||
if (async)
|
||||
ast_async_goto(chan, context, exten, ipri);
|
||||
else
|
||||
ast_explicit_goto(chan, context, exten, ipri);
|
||||
|
||||
ast_cdr_update(chan);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int ast_parseable_goto(struct ast_channel *chan, const char *goto_string)
|
||||
{
|
||||
return pbx_parseable_goto(chan, goto_string, 0);
|
||||
}
|
||||
|
||||
int ast_async_parseable_goto(struct ast_channel *chan, const char *goto_string)
|
||||
{
|
||||
return pbx_parseable_goto(chan, goto_string, 1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user