[asterisk-commits] bweschke: branch bweschke/originate_w_jabber r95260 - /team/bweschke/originat...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Dec 28 16:14:00 CST 2007


Author: bweschke
Date: Fri Dec 28 16:14:00 2007
New Revision: 95260

URL: http://svn.digium.com/view/asterisk?view=rev&rev=95260
Log:
 Progress commit. Getting there!


Modified:
    team/bweschke/originate_w_jabber/main/manager.c
    team/bweschke/originate_w_jabber/main/pbx.c

Modified: team/bweschke/originate_w_jabber/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/originate_w_jabber/main/manager.c?view=diff&rev=95260&r1=95259&r2=95260
==============================================================================
--- team/bweschke/originate_w_jabber/main/manager.c (original)
+++ team/bweschke/originate_w_jabber/main/manager.c Fri Dec 28 16:14:00 2007
@@ -83,6 +83,9 @@
 	char exten[AST_MAX_EXTENSION];
 	char idtext[AST_MAX_EXTENSION];
 	char account[AST_MAX_ACCOUNT_CODE];
+	char callid[AST_MAX_EXTENSION];
+	char origjid[AST_MAX_EXTENSION];
+	char jabberclient[AST_MAX_EXTENSION];
 	int priority;
 	struct ast_variable *vars;
 };
@@ -1739,6 +1742,32 @@
 	int reason = 0;
 	struct ast_channel *chan = NULL;
 	char requested_channel[AST_CHANNEL_NAME];
+	struct ast_variable *cur;
+
+	if (!ast_strlen_zero(in->callid)) {
+		cur = ast_variable_new("orig_callid", in->callid);
+		if (in->vars) {
+			cur->next = in->vars;
+			in->vars = cur;
+		} else
+			in->vars = cur;
+	}
+	if (!ast_strlen_zero(in->origjid)) {
+		cur = ast_variable_new("orig_origjid", in->origjid);
+		if (in->vars) {
+			cur->next = in->vars;
+			in->vars = cur;
+		} else
+			in->vars = cur;
+	}
+	if (!ast_strlen_zero(in->jabberclient)) {
+		cur = ast_variable_new("orig_jabberclient", in->jabberclient);
+		if (in->vars) {
+			cur->next = in->vars;
+			in->vars = cur;
+		} else
+			in->vars = cur;
+	}
 
 	if (!ast_strlen_zero(in->app)) {
 		res = ast_pbx_outgoing_app(in->tech, AST_FORMAT_SLINEAR, in->data, in->timeout, in->app, in->appdata, &reason, 1, 
@@ -1809,6 +1838,9 @@
 	const char *appdata = astman_get_header(m, "Data");
 	const char *async = astman_get_header(m, "Async");
 	const char *id = astman_get_header(m, "ActionID");
+	const char *callid = astman_get_header(m, "CallID");
+	const char *origjid = astman_get_header(m, "OrigJID");
+	const char *jabberclient = astman_get_header(m, "JabberClient");
 	struct ast_variable *vars = astman_get_variables(m);
 	char *tech, *data;
 	char *l = NULL, *n = NULL;
@@ -1861,6 +1893,12 @@
 		} else {
 			if (!ast_strlen_zero(id))
 				snprintf(fast->idtext, sizeof(fast->idtext), "ActionID: %s\r\n", id);
+			if (!ast_strlen_zero(callid))
+				ast_copy_string(fast->callid, callid, sizeof(fast->callid));
+			if (!ast_strlen_zero(origjid))
+				ast_copy_string(fast->origjid, origjid, sizeof(fast->origjid));
+			if (!ast_strlen_zero(jabberclient))
+				ast_copy_string(fast->jabberclient, jabberclient, sizeof(fast->jabberclient));
 			ast_copy_string(fast->tech, tech, sizeof(fast->tech));
    			ast_copy_string(fast->data, data, sizeof(fast->data));
 			ast_copy_string(fast->app, app, sizeof(fast->app));

Modified: team/bweschke/originate_w_jabber/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/originate_w_jabber/main/pbx.c?view=diff&rev=95260&r1=95259&r2=95260
==============================================================================
--- team/bweschke/originate_w_jabber/main/pbx.c (original)
+++ team/bweschke/originate_w_jabber/main/pbx.c Fri Dec 28 16:14:00 2007
@@ -4904,6 +4904,11 @@
 	int res;
 	struct ast_frame *f;
 	struct ast_app *app;
+
+	if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "orig_jabberclient"))) {
+		if (option_debug > 2) 
+			ast_log(LOG_DEBUG, "This asynchronous originate wants XMPP call progress signaling.\n");
+	}
 
 	while (timeout && (chan->_state != AST_STATE_UP)) {
 		res = ast_waitfor(chan, timeout);




More information about the asterisk-commits mailing list