Index: asterisk/manager.c
===================================================================
RCS file: /usr/cvsroot/asterisk/manager.c,v
retrieving revision 1.13
diff -u -r1.13 manager.c
--- asterisk/manager.c	21 Jun 2003 20:05:16 -0000	1.13
+++ asterisk/manager.c	26 Jun 2003 19:00:21 -0000
@@ -405,6 +405,8 @@
 	char *priority = astman_get_header(m, "Priority");
 	char *timeout = astman_get_header(m, "Timeout");
 	char *callerid = astman_get_header(m, "CallerID");
+	char *app = astman_get_header(m, "Application");
+	char *appdata = astman_get_header(m, "Data");
 	char *tech, *data;
 	int pi = 0;
 	int res;
@@ -432,7 +434,11 @@
 	}
 	*data = '\0';
 	data++;
-	res = ast_pbx_outgoing_exten(tech, AST_FORMAT_SLINEAR, data, to, context, exten, pi, &reason, 0, strlen(callerid) ? callerid : NULL, NULL );
+	if (strlen(app)) {
+           res = ast_pbx_outgoing_app(tech, AST_FORMAT_SLINEAR, data, to, app, appdata, &reason, 0, strlen(callerid) ? callerid : NULL );
+       	} else {
+	   res = ast_pbx_outgoing_exten(tech, AST_FORMAT_SLINEAR, data, to, context, exten, pi, &reason, 0, strlen(callerid) ? callerid : NULL, NULL );
+	}   
 	if (!res)
 		astman_send_ack(s, "Originate successfully queued");
 	else
