summaryrefslogtreecommitdiff
path: root/funcs/func_channel.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2013-06-26 20:59:14 +0000
committerJonathan Rose <jrose@digium.com>2013-06-26 20:59:14 +0000
commitd014ad2261b1a4ffb590edcd7b7b4d6c31a74457 (patch)
tree05b525a5d1e609e1e30ebc1d9082fd8aebab1c64 /funcs/func_channel.c
parent609c42c854c8880548571241b893604c02d513d4 (diff)
func_channel: Read/Write after_bridge_goto option
Allows reading and setting of a channel's after_bridge_goto datastore (closes issue ASTERISK-21875) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2628/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs/func_channel.c')
-rw-r--r--funcs/func_channel.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/funcs/func_channel.c b/funcs/func_channel.c
index 4327fd257..9dd210c4e 100644
--- a/funcs/func_channel.c
+++ b/funcs/func_channel.c
@@ -37,6 +37,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/module.h"
#include "asterisk/channel.h"
+#include "asterisk/bridging.h"
#include "asterisk/pbx.h"
#include "asterisk/utils.h"
#include "asterisk/app.h"
@@ -118,6 +119,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
<enum name="checkhangup">
<para>R/O Whether the channel is hanging up (1/0)</para>
</enum>
+ <enum name="after_bridge_goto">
+ <para>R/W the parseable goto string indicating where the channel is
+ expected to return to in the PBX after exiting the next bridge it joins
+ on the condition that it doesn't hang up. The parseable goto string uses
+ the same syntax as the <literal>Goto</literal> application.</para>
+ </enum>
<enum name="hangup_handler_pop">
<para>W/O Replace the most recently added hangup handler
with a new hangup handler on the channel if supplied. The
@@ -475,6 +482,8 @@ static int func_channel_read(struct ast_channel *chan, const char *function,
struct ast_str *tmp_str = ast_str_alloca(1024);
locked_copy_string(chan, buf, ast_print_namedgroups(&tmp_str, ast_channel_named_pickupgroups(chan)), len);
+ } else if (!strcasecmp(data, "after_bridge_goto")) {
+ ast_after_bridge_goto_read(chan, buf, len);
} else if (!strcasecmp(data, "amaflags")) {
ast_channel_lock(chan);
snprintf(buf, len, "%d", ast_channel_amaflags(chan));
@@ -516,7 +525,13 @@ static int func_channel_write_real(struct ast_channel *chan, const char *functio
locked_string_field_set(chan, accountcode, value);
else if (!strcasecmp(data, "userfield"))
locked_string_field_set(chan, userfield, value);
- else if (!strcasecmp(data, "amaflags")) {
+ else if (!strcasecmp(data, "after_bridge_goto")) {
+ if (ast_strlen_zero(value)) {
+ ast_after_bridge_goto_discard(chan);
+ } else {
+ ast_after_bridge_set_go_on(chan, ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan), value);
+ }
+ } else if (!strcasecmp(data, "amaflags")) {
ast_channel_lock(chan);
if (isdigit(*value)) {
int amaflags;