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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 20 14:09:49 CDT 2009


Author: mmichelson
Date: Wed May 20 14:09:39 2009
New Revision: 195761

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=195761
Log:
Implement a test scenario in app_dial. It works!

This last bit of playing around is making me think that the RECV macros
are superfluous. I may axe them.

What's here right now is probably a bit inefficient, but currently I'm worried
more about correctness than optimizing things.


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=195761&r1=195760&r2=195761
==============================================================================
--- team/mmichelson/digit_manipulation/apps/app_dial.c (original)
+++ team/mmichelson/digit_manipulation/apps/app_dial.c Wed May 20 14:09:39 2009
@@ -1072,8 +1072,17 @@
 						ast_party_connected_line_set(&o->connected, &connected);
 						ast_party_connected_line_free(&connected);
 					} else {
+						const char * const macro = ast_strdupa(S_OR(pbx_builtin_getvar_helper(in, "CONNECTED_LINE_CALLER_SEND_MACRO"), ""));
+						const char * const args = ast_strdupa(S_OR(pbx_builtin_getvar_helper(in, "CONNECTED_LINE_CALLER_SEND_MACRO_ARGS"), ""));
+						ast_log(LOG_NOTICE, "macro is %s and args is %s\n", macro, args);
 						ast_verb(3, "%s connected line has changed, passing it to %s\n", c->name, in->name);
-						ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
+						if (!ast_strlen_zero(macro)) {
+							ast_connected_line_parse_data(f->data.ptr, f->datalen, &in->connected);
+							ast_app_run_macro(c, in, macro, args);
+							ast_channel_update_connected_line(in, &in->connected);
+						} else {
+							ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
+						}
 					}
 					break;
 				case AST_CONTROL_REDIRECTING:




More information about the asterisk-commits mailing list