[asterisk-commits] mmichelson: branch mmichelson/digit_manipulation r195836 - /team/mmichelson/d...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 20 16:39:38 CDT 2009


Author: mmichelson
Date: Wed May 20 16:39:20 2009
New Revision: 195836

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=195836
Log:
Add case in app_dial to call the CALLEE_SEND macro.


Modified:
    team/mmichelson/digit_manipulation/apps/app_dial.c

Modified: team/mmichelson/digit_manipulation/apps/app_dial.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/mmichelson/digit_manipulation/apps/app_dial.c?view=diff&rev=195836&r1=195835&r2=195836
==============================================================================
--- team/mmichelson/digit_manipulation/apps/app_dial.c (original)
+++ team/mmichelson/digit_manipulation/apps/app_dial.c Wed May 20 16:39:20 2009
@@ -1222,15 +1222,26 @@
 				if (ast_write(outgoing->chan, f))
 					ast_log(LOG_WARNING, "Unable to forward voice or dtmf\n");
 			}
-			if (single && (f->frametype == AST_FRAME_CONTROL) &&
-				((f->subclass == AST_CONTROL_HOLD) ||
-				(f->subclass == AST_CONTROL_UNHOLD) ||
-				(f->subclass == AST_CONTROL_VIDUPDATE) ||
-				(f->subclass == AST_CONTROL_SRCUPDATE) ||
-				(f->subclass == AST_CONTROL_CONNECTED_LINE) ||
-				(f->subclass == AST_CONTROL_REDIRECTING))) {
-				ast_verb(3, "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name);
-				ast_indicate_data(outgoing->chan, f->subclass, f->data.ptr, f->datalen);
+			if (single && (f->frametype == AST_FRAME_CONTROL)) { 
+				if ((f->subclass == AST_CONTROL_HOLD) ||
+				    (f->subclass == AST_CONTROL_UNHOLD) ||
+				    (f->subclass == AST_CONTROL_VIDUPDATE) ||
+				    (f->subclass == AST_CONTROL_SRCUPDATE) ||
+				    (f->subclass == AST_CONTROL_REDIRECTING)) {
+					ast_verb(3, "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name);
+					ast_indicate_data(outgoing->chan, f->subclass, f->data.ptr, f->datalen);
+				} else if (f->subclass == AST_CONTROL_CONNECTED_LINE) {
+					const char * const macro = ast_strdupa(S_OR(pbx_builtin_getvar_helper(in, "CONNECTED_LINE_CALLEE_SEND_MACRO"), ""));
+					const char * const args = ast_strdupa(S_OR(pbx_builtin_getvar_helper(in, "CONNECTED_LINE_CALLEE_SEND_MACRO_ARGS"), ""));
+					ast_log(LOG_NOTICE, "macro is %s and args is %s\n", macro, args);
+					if (!ast_strlen_zero(macro)) {
+						ast_connected_line_parse_data(f->data.ptr, f->datalen, &outgoing->chan->connected);
+						ast_app_run_macro(in, outgoing->chan, macro, args);
+						ast_channel_update_connected_line(outgoing->chan, &outgoing->chan->connected);
+					} else {
+						ast_indicate_data(outgoing->chan, f->subclass, f->data.ptr, f->datalen);
+					}
+				}
 			}
 			ast_frfree(f);
 		}




More information about the asterisk-commits mailing list