[Pkg-voip-commits] r5793 - in /asterisk/trunk/debian: changelog patches/bristuff/ast-send-message patches/bristuff/ast-send-message-users patches/series

paravoid at alioth.debian.org paravoid at alioth.debian.org
Sun May 25 20:34:09 UTC 2008


Author: paravoid
Date: Sun May 25 20:34:09 2008
New Revision: 5793

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=5793
Log:
Merge ast-send-message with ast-send-message-users, following upstream
split.

Removed:
    asterisk/trunk/debian/patches/bristuff/ast-send-message-users
Modified:
    asterisk/trunk/debian/changelog
    asterisk/trunk/debian/patches/bristuff/ast-send-message
    asterisk/trunk/debian/patches/series

Modified: asterisk/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/changelog?rev=5793&op=diff
==============================================================================
--- asterisk/trunk/debian/changelog (original)
+++ asterisk/trunk/debian/changelog Sun May 25 20:34:09 2008
@@ -25,9 +25,11 @@
       upstream.
     - Rename app-zapras-fix-audiomode to isdn-fixes and include another fix
       that we dropped earlier by mistake (r5162).
+    - Merge ast-send-message with ast-send-message-users, following upstream
+      split.
     - Other minor and cosmetic fixes.
 
- -- Faidon Liambotis <paravoid at debian.org>  Sun, 25 May 2008 22:31:46 +0300
+ -- Faidon Liambotis <paravoid at debian.org>  Sun, 25 May 2008 23:33:22 +0300
 
 asterisk (1:1.4.19.1~dfsg-1) unstable; urgency=low
 

Modified: asterisk/trunk/debian/patches/bristuff/ast-send-message
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/bristuff/ast-send-message?rev=5793&op=diff
==============================================================================
--- asterisk/trunk/debian/patches/bristuff/ast-send-message (original)
+++ asterisk/trunk/debian/patches/bristuff/ast-send-message Sun May 25 20:34:09 2008
@@ -95,3 +95,139 @@
  /*! \ brief Convert channel reloadreason (ENUM) to text string for manager event */
  const char *channelreloadreason2txt(enum channelreloadreason reason)
  {
+--- a/main/manager.c
++++ b/main/manager.c
+@@ -11,6 +11,9 @@
+  * the project provides a web site, mailing lists and IRC
+  * channels for your use.
+  *
++ * Copyright (C) 2003-2004, Junghanns.NET Gmbh
++ * Klaus-Peter Junghanns <kpj at junghanns.net>
++ *
+  * This program is free software, distributed under the terms of
+  * the GNU General Public License Version 2. See the LICENSE file
+  * at the top of the source tree.
+@@ -1426,6 +1429,49 @@ static int action_hangup(struct mansessi
+ 	return 0;
+ }
+ 
++static char mandescr_message[] =
++"Description: Send a message\n"
++"Variables: \n"
++"	Channel: The destination channel(e.g. SIP/phone1)\n"
++"	From:	 \n"
++"	Message: The message to send\n";
++
++static int action_message(struct mansession *s, const struct message *m)
++{
++	const char *name = astman_get_header(m, "Channel");
++	const char *from = astman_get_header(m, "From");
++	const char *message = astman_get_header(m, "Message");
++	const char *pdu = astman_get_header(m, "PDU");
++	char tmp[256];
++	char *tech, *data;
++	int res;
++	if (ast_strlen_zero(name) || (ast_strlen_zero(message) && ast_strlen_zero(pdu))) {
++		astman_send_error(s, m, "No channel or message/PDU specified");
++		return 0;
++	}
++	ast_copy_string(tmp, name, sizeof(tmp));
++	tech = tmp;
++	data = strchr(tmp, '/');
++	if (!data) {
++		astman_send_error(s, m, "Invalid channel\n");
++		return 0;
++	}
++	*data = '\0';
++	data++;
++	if (ast_strlen_zero(pdu)) {
++	    res = ast_send_message(tech, (char *)data, (char *)name, (char *)from, (char *)message, 0);
++	} else {
++	    res = ast_send_message(tech, (char *)data, (char *)name, (char *)from, (char *)pdu, 1);
++	}
++
++	if (res) {
++		astman_send_error(s, m, "Error sending message");
++		return 0;
++	}
++	astman_send_ack(s, m, "Message sent");
++	return 0;
++}
++
+ static char mandescr_setvar[] = 
+ "Description: Set a global or local channel variable.\n"
+ "Variables: (Names marked with * are required)\n"
+@@ -2840,6 +2886,7 @@ int init_manager(void)
+ 		ast_manager_register2("Events", 0, action_events, "Control Event Flow", mandescr_events);
+ 		ast_manager_register2("Logoff", 0, action_logoff, "Logoff Manager", mandescr_logoff);
+ 		ast_manager_register2("Hangup", EVENT_FLAG_CALL, action_hangup, "Hangup Channel", mandescr_hangup);
++		ast_manager_register2("Message", EVENT_FLAG_CALL, action_message, "Send Message", mandescr_message);
+ 		ast_manager_register("Status", EVENT_FLAG_CALL, action_status, "Lists channel status" );
+ 		ast_manager_register2("Setvar", EVENT_FLAG_CALL, action_setvar, "Set Channel Variable", mandescr_setvar );
+ 		ast_manager_register2("Getvar", EVENT_FLAG_CALL, action_getvar, "Gets a Channel Variable", mandescr_getvar );
+--- a/pbx/pbx_spool.c
++++ b/pbx/pbx_spool.c
+@@ -87,6 +87,10 @@ struct outgoing {
+ 	char app[256];
+ 	char data[256];
+ 
++	/* If SMS */
++	char message[256];
++	char pdu[256];
++
+ 	/* If extension/context/priority */
+ 	char exten[256];
+ 	char context[256];
+@@ -181,6 +185,10 @@ static int apply_outgoing(struct outgoin
+ 					ast_copy_string(o->app, c, sizeof(o->app));
+ 				} else if (!strcasecmp(buf, "data")) {
+ 					ast_copy_string(o->data, c, sizeof(o->data));
++				} else if (!strcasecmp(buf, "message")) {
++					strncpy(o->message, c, sizeof(o->message) - 1);
++				} else if (!strcasecmp(buf, "pdu")) {
++					strncpy(o->pdu, c, sizeof(o->pdu) - 1);
+ 				} else if (!strcasecmp(buf, "maxretries")) {
+ 					if (sscanf(c, "%d", &o->maxretries) != 1) {
+ 						ast_log(LOG_WARNING, "Invalid max retries at line %d of %s\n", lineno, fn);
+@@ -241,8 +249,8 @@ static int apply_outgoing(struct outgoin
+ 		}
+ 	}
+ 	ast_copy_string(o->fn, fn, sizeof(o->fn));
+-	if (ast_strlen_zero(o->tech) || ast_strlen_zero(o->dest) || (ast_strlen_zero(o->app) && ast_strlen_zero(o->exten))) {
+-		ast_log(LOG_WARNING, "At least one of app or extension must be specified, along with tech and dest in file %s\n", fn);
++	if (ast_strlen_zero(o->tech) || ast_strlen_zero(o->dest) || ((ast_strlen_zero(o->app) && ast_strlen_zero(o->exten) && ast_strlen_zero(o->message) && ast_strlen_zero(o->pdu)))) {
++		ast_log(LOG_WARNING, "At least one of app or extension (or keyword message/pdu)must be specified, along with tech and dest in file %s\n", fn);
+ 		return -1;
+ 	}
+ 	return 0;
+@@ -332,6 +340,14 @@ static void *attempt_thread(void *data)
+ 		if (option_verbose > 2)
+ 			ast_verbose(VERBOSE_PREFIX_3 "Attempting call on %s/%s for application %s(%s) (Retry %d)\n", o->tech, o->dest, o->app, o->data, o->retries);
+ 		res = ast_pbx_outgoing_app(o->tech, AST_FORMAT_SLINEAR, o->dest, o->waittime * 1000, o->app, o->data, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
++	} else if (!ast_strlen_zero(o->message)) {
++		if (option_verbose > 2)
++			ast_verbose(VERBOSE_PREFIX_3 "Attempting to send message on %s/%s (Retry %d)\n", o->tech, o->dest, o->retries);
++		res = ast_send_message(o->tech, o->dest, o->dest, (ast_strlen_zero(o->cid_name) ? o->cid_num : o->cid_name), o->message, 0);
++	} else if (!ast_strlen_zero(o->pdu)) {
++		if (option_verbose > 2)
++			ast_verbose(VERBOSE_PREFIX_3 "Attempting to send message in PDU format on %s/%s (Retry %d)\n", o->tech, o->dest, o->retries);
++		res = ast_send_message(o->tech, o->dest, o->dest, (ast_strlen_zero(o->cid_name) ? o->cid_num : o->cid_name), o->pdu, 1);
+ 	} else {
+ 		if (option_verbose > 2)
+ 			ast_verbose(VERBOSE_PREFIX_3 "Attempting call on %s/%s for %s@%s:%d (Retry %d)\n", o->tech, o->dest, o->exten, o->context,o->priority, o->retries);
+@@ -348,9 +364,14 @@ static void *attempt_thread(void *data)
+ 			safe_append(o, time(NULL), "EndRetry");
+ 		}
+ 	} else {
++	    if (!ast_strlen_zero(o->message)) {
++		if (option_verbose > 2)
++		    ast_verbose(VERBOSE_PREFIX_2 "Message sent to %s/%s\n", o->tech, o->dest);
++	    } else {
+ 		ast_log(LOG_NOTICE, "Call completed to %s/%s\n", o->tech, o->dest);
+ 		ast_log(LOG_EVENT, "Queued call to %s/%s completed\n", o->tech, o->dest);
+-		remove_from_queue(o, "Completed");
++	    }
++	    remove_from_queue(o, "Completed");
+ 	}
+ 	free_outgoing(o);
+ 	return NULL;

Modified: asterisk/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/series?rev=5793&op=diff
==============================================================================
--- asterisk/trunk/debian/patches/series (original)
+++ asterisk/trunk/debian/patches/series Sun May 25 20:34:09 2008
@@ -63,11 +63,10 @@
 
 # use /usr/include/bristuffed/libpri.h - /usr/lib/libpri-bristuffed.so.1.0
 use-libpri-bristuffed
+# euroISDN, BRI support
 bristuff/zapata-bri+euroisdn
 
-# and here goes our API :-)
 bristuff/ast-send-message
-bristuff/ast-send-message-users # XXX: merge this with above?
 
 # don't split these up!
 bristuff/ast_monitor_start-targetscript
@@ -77,12 +76,12 @@
 bristuff/uniqueid-30-app-chanspy
 bristuff/uniqueid-40-manager
 
-# euroISDN, BRI support
-# they depend on the uniqueid changes; the following are a set
+# these depend on the uniqueid changes; the following are a set
 bristuff/feature-autoanswer
 bristuff/feature-holdedcalls
 
 bristuff/zapata_euroisdn_holded
+
 # GSM support; it needs the above patch applied first, unfortunately.
 bristuff/zapata-gsm
 




More information about the Pkg-voip-commits mailing list