[asterisk-commits] mmichelson: branch mmichelson/digit_manipulation r196069 - /team/mmichelson/d...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu May 21 14:46:19 CDT 2009
Author: mmichelson
Date: Thu May 21 14:46:14 2009
New Revision: 196069
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=196069
Log:
Call the macro during a bridge if necessary.
This is so cool.
Modified:
team/mmichelson/digit_manipulation/main/features.c
Modified: team/mmichelson/digit_manipulation/main/features.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/mmichelson/digit_manipulation/main/features.c?view=diff&rev=196069&r1=196068&r2=196069
==============================================================================
--- team/mmichelson/digit_manipulation/main/features.c (original)
+++ team/mmichelson/digit_manipulation/main/features.c Thu May 21 14:46:14 2009
@@ -2627,6 +2627,8 @@
}
for (;;) {
struct ast_channel *other; /* used later */
+ char macro[AST_MAX_CONTEXT];
+ char macro_args[512]; /*XXX Big enough? */
res = ast_channel_bridge(chan, peer, config, &f, &who);
@@ -2712,9 +2714,18 @@
case -1:
ast_indicate(other, f->subclass);
break;
+ case AST_CONTROL_CONNECTED_LINE:
+ ast_copy_string(macro, S_OR(pbx_builtin_getvar_helper(who, who == chan ? "CONNECTED_LINE_CALLEE_SEND_MACRO" : "CONNECTED_LINE_CALLER_SEND_MACRO"), ""), sizeof(macro));
+ ast_copy_string(macro_args, S_OR(pbx_builtin_getvar_helper(who, who == chan ? "CONNECTED_LINE_CALLEE_SEND_MACRO_ARGS " : "CONNECTED_LINE_CALLER_SEND_MACRO_ARGS"), ""), sizeof(macro_args));
+ if (!ast_strlen_zero(macro)) {
+ ast_connected_line_parse_data(f->data.ptr, f->datalen, &other->connected);
+ ast_app_run_macro(who, other, macro, macro_args);
+ ast_channel_update_connected_line(other, &other->connected);
+ break;
+ }
+ /* The implied "else" falls through purposely */
case AST_CONTROL_HOLD:
case AST_CONTROL_UNHOLD:
- case AST_CONTROL_CONNECTED_LINE:
ast_indicate_data(other, f->subclass, f->data.ptr, f->datalen);
break;
case AST_CONTROL_OPTION:
More information about the asterisk-commits
mailing list