Asterisk autosupport script not recognized as such

Tzafrir Cohen tzafrir.cohen@xorcom.com
Tue Jul 5 08:26:03 UTC 2005


--i3lJ51RuaGWuFYNw
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jul 04, 2005 at 01:59:44AM +0200, J=E9r=F4me Warnier wrote:
> The script contrib/scripts/autosupport (/usr/sbin/autosupport once
> installed) is not recognized as a script because the shebang line is
> misplaced.
>=20
> Here is a small patch to move it to its logical and useful position:


autosupport.dpatch

  Make that script a proper bourne shell script like it's supposed to
	be. IIRC I verified it has no bashism.

	Needs submitting to digium.


iax_general_conf.dpatch

   currently a two-liner to allow setting the
   default context for chan_iax2 to something other than "default".
	 Turns out that there was already a global, and all I had to do was to
	 set it.

	 Makes my IAX settings saner.

	 Feature already in HEAD.


vm_italic.dpatch: See http://bugs.debian.org/301490

  This is a backport from HEAD. Also note that this only backports the
	itlic parts of app_voicemail, and not the ones of say.c .


vm_password_cmd: See http://bugs.debian.org/312770

  This is a patch I need for Rapid, but I'd appreciate some feedback
	here.=20

	Bug report has been submitted.


30_ast-data-dir.dpatch:

  This version of the patch moves the changes up/down a few lines to
	avoid conflicting with bristuff.

--=20
Tzafrir Cohen     icq#16849755  +972-50-7952406
tzafrir.cohen@xorcom.com  http://www.xorcom.com

--i3lJ51RuaGWuFYNw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="autosupport.dpatch"

#! /bin/sh /usr/share/dpatch/dpatch-run
## autosupport.dpatch by Tzafrir Cohen <tzafrir.cohen@xorcom.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad asterisk-1.0.7/contrib/scripts/autosupport /tmp/dpep.oXClLf/asterisk-1.0.7/contrib/scripts/autosupport
--- asterisk-1.0.7/contrib/scripts/autosupport	2005-03-11 19:15:22.000000000 +0200
+++ /tmp/dpep.oXClLf/asterisk-1.0.7/contrib/scripts/autosupport	2005-05-14 04:17:48.673155807 +0300
@@ -1,3 +1,4 @@
+#!/bin/sh
 #
 # Collect support information
 #
@@ -8,7 +9,6 @@
 # Distributed under the terms of the GNU General Public
 # License
 #
-#!/bin/bash
 
 OUTPUT=$HOME/digiuminfo
 

--i3lJ51RuaGWuFYNw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="30_ast-data-dir.dpatch"

#! /bin/sh /usr/share/dpatch/dpatch-run
## data_dir.dpatch by Xorcom Ltd. (software releases key) <support@xorcom.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Add a separate, configurable "data dir" directory, defaults to 
## DP: /usr/share/asterisk

@DPATCH@
diff -urNad asterisk-1.0.8.dfsg.1/astconf.h /tmp/dpep.RIoflc/asterisk-1.0.8.dfsg.1/astconf.h
--- asterisk-1.0.8.dfsg.1/astconf.h	2003-01-30 17:03:20.000000000 +0200
+++ /tmp/dpep.RIoflc/asterisk-1.0.8.dfsg.1/astconf.h	2005-06-25 16:04:49.000000000 +0300
@@ -19,6 +19,7 @@
 extern char ast_config_AST_CONFIG_DIR[AST_CONFIG_MAX_PATH];
 extern char ast_config_AST_CONFIG_FILE[AST_CONFIG_MAX_PATH];
 extern char ast_config_AST_MODULE_DIR[AST_CONFIG_MAX_PATH];
+extern char ast_config_AST_DATA_DIR[AST_CONFIG_MAX_PATH];
 extern char ast_config_AST_SPOOL_DIR[AST_CONFIG_MAX_PATH];
 extern char ast_config_AST_VAR_DIR[AST_CONFIG_MAX_PATH];
 extern char ast_config_AST_LOG_DIR[AST_CONFIG_MAX_PATH];
diff -urNad asterisk-1.0.8.dfsg.1/asterisk.c /tmp/dpep.RIoflc/asterisk-1.0.8.dfsg.1/asterisk.c
--- asterisk-1.0.8.dfsg.1/asterisk.c	2005-05-16 06:04:58.000000000 +0300
+++ /tmp/dpep.RIoflc/asterisk-1.0.8.dfsg.1/asterisk.c	2005-06-25 16:08:30.000000000 +0300
@@ -119,6 +119,7 @@
 char ast_config_AST_VAR_DIR[AST_CONFIG_MAX_PATH];
 char ast_config_AST_LOG_DIR[AST_CONFIG_MAX_PATH];
 char ast_config_AST_AGI_DIR[AST_CONFIG_MAX_PATH];
+char ast_config_AST_DATA_DIR[AST_CONFIG_MAX_PATH];
 char ast_config_AST_DB[AST_CONFIG_MAX_PATH];
 char ast_config_AST_KEY_DIR[AST_CONFIG_MAX_PATH];
 char ast_config_AST_PID[AST_CONFIG_MAX_PATH];
@@ -1506,6 +1507,7 @@
 	strncpy((char *)ast_config_AST_VAR_DIR,AST_VAR_DIR,sizeof(ast_config_AST_VAR_DIR)-1);
 	strncpy((char *)ast_config_AST_LOG_DIR,AST_LOG_DIR,sizeof(ast_config_AST_LOG_DIR)-1);
 	strncpy((char *)ast_config_AST_AGI_DIR,AST_AGI_DIR,sizeof(ast_config_AST_AGI_DIR)-1);
+ 	strncpy((char *)ast_config_AST_DATA_DIR,AST_DATA_DIR,sizeof(ast_config_AST_DATA_DIR)-1);
 	strncpy((char *)ast_config_AST_DB,AST_DB,sizeof(ast_config_AST_DB)-1);
 	strncpy((char *)ast_config_AST_KEY_DIR,AST_KEY_DIR,sizeof(ast_config_AST_KEY_DIR)-1);
 	strncpy((char *)ast_config_AST_PID,AST_PID,sizeof(ast_config_AST_PID)-1);
diff -urNad asterisk-1.0.8.dfsg.1/asterisk.h /tmp/dpep.RIoflc/asterisk-1.0.8.dfsg.1/asterisk.h
--- asterisk-1.0.8.dfsg.1/asterisk.h	2004-09-07 18:02:53.000000000 +0300
+++ /tmp/dpep.RIoflc/asterisk-1.0.8.dfsg.1/asterisk.h	2005-06-25 16:03:15.000000000 +0300
@@ -24,6 +24,7 @@
 #define AST_MODULE_DIR 	ASTMODDIR
 #define AST_SPOOL_DIR  	ASTSPOOLDIR
 #define AST_VAR_DIR    	ASTVARLIBDIR
+#define AST_DATA_DIR	ASTDATADIR
 #define AST_LOG_DIR	ASTLOGDIR
 #define AST_AGI_DIR	ASTAGIDIR
 #define AST_KEY_DIR	ASTVARLIBDIR "/keys"
@@ -32,8 +33,8 @@
 
 #define AST_CONFIG_FILE ASTCONFPATH
 
-#define AST_SOUNDS AST_VAR_DIR "/sounds"
-#define AST_IMAGES AST_VAR_DIR "/images"
+#define AST_SOUNDS AST_DATA_DIR "/sounds"
+#define AST_IMAGES AST_DATA_DIR "/images"
 
 /* Provided by module.c */
 extern int load_modules(void);
diff -urNad asterisk-1.0.8.dfsg.1/file.c /tmp/dpep.RIoflc/asterisk-1.0.8.dfsg.1/file.c
--- asterisk-1.0.8.dfsg.1/file.c	2005-06-14 21:41:48.000000000 +0300
+++ /tmp/dpep.RIoflc/asterisk-1.0.8.dfsg.1/file.c	2005-06-25 16:03:15.000000000 +0300
@@ -284,7 +284,7 @@
 	int fnsize = 0;
 	char tmp[AST_CONFIG_MAX_PATH]="";
 
-	snprintf(tmp, sizeof(tmp), "%s/%s", ast_config_AST_VAR_DIR, "sounds");
+	snprintf(tmp, sizeof(tmp), "%s/%s", ast_config_AST_DATA_DIR, "sounds");
 	fnsize = strlen(tmp) + strlen(filename) + strlen(ext) + 10;
 	fn = malloc(fnsize);
 	if (fn) {
diff -urNad asterisk-1.0.8.dfsg.1/image.c /tmp/dpep.RIoflc/asterisk-1.0.8.dfsg.1/image.c
--- asterisk-1.0.8.dfsg.1/image.c	2004-06-22 21:48:59.000000000 +0300
+++ /tmp/dpep.RIoflc/asterisk-1.0.8.dfsg.1/image.c	2005-06-25 16:03:15.000000000 +0300
@@ -95,9 +95,9 @@
 			snprintf(buf, len, "%s.%s", filename, ext);
 	} else {
 		if (preflang && strlen(preflang))
-			snprintf(buf, len, "%s/%s/%s-%s.%s", ast_config_AST_VAR_DIR, "images", filename, preflang, ext);
+			snprintf(buf, len, "%s/%s/%s-%s.%s", ast_config_AST_DATA_DIR, "images", filename, preflang, ext);
 		else
-			snprintf(buf, len, "%s/%s/%s.%s", ast_config_AST_VAR_DIR, "images", filename, ext);
+			snprintf(buf, len, "%s/%s/%s.%s", ast_config_AST_DATA_DIR, "images", filename, ext);
 	}
 }
 

--i3lJ51RuaGWuFYNw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="iax_general_conf.dpatch"

#! /bin/sh /usr/share/dpatch/dpatch-run
## iax_general_conf.dpatch by Xorcom Ltd. (software releases key) <support@xorcom.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Adds a 'context' directivein the general section to give a default 
## DP: context

@DPATCH@
diff -urNad asterisk-1.0.8.dfsg.1/channels/chan_iax2.c /tmp/dpep.9MANKo/asterisk-1.0.8.dfsg.1/channels/chan_iax2.c
--- asterisk-1.0.8.dfsg.1/channels/chan_iax2.c	2005-06-28 11:20:20.000000000 +0300
+++ /tmp/dpep.9MANKo/asterisk-1.0.8.dfsg.1/channels/chan_iax2.c	2005-06-28 11:22:48.000000000 +0300
@@ -6871,6 +6871,8 @@
 			lagrq_time = atoi(v->value);
 		else if (!strcasecmp(v->name, "dropcount")) 
 			iax2_dropcount = atoi(v->value);
+		else if (!strcasecmp(v->name, "context"))
+			strncpy(context, v->value, sizeof(context) - 1);
 		else if (!strcasecmp(v->name, "bindaddr"))
 			inet_aton(v->value, &sin->sin_addr);
 		else if (!strcasecmp(v->name, "authdebug"))

--i3lJ51RuaGWuFYNw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="vm_italic.dpatch"

#! /bin/sh /usr/share/dpatch/dpatch-run
## vm_italic.dpatch by Xorcom Ltd. (software releases key) <support@xorcom.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad asterisk-1.0.8.dfsg.1/apps/app_voicemail.c /tmp/dpep.6z3G7j/asterisk-1.0.8.dfsg.1/apps/app_voicemail.c
--- asterisk-1.0.8.dfsg.1/apps/app_voicemail.c	2005-05-31 16:08:45.000000000 +0300
+++ /tmp/dpep.6z3G7j/asterisk-1.0.8.dfsg.1/apps/app_voicemail.c	2005-06-25 23:06:23.000000000 +0300
@@ -2719,6 +2719,59 @@
 	return res;
 }
 
+/* ITALIAN syntax */
+static int vm_intro_it(struct ast_channel *chan,struct vm_state *vms)
+{
+        /* Introduce messages they have */
+        int res;
+        if (!vms->oldmessages && !vms->newmessages) {
+		res = ast_play_and_wait(chan, "vm-no");
+		if (!res)
+			res = ast_play_and_wait(chan, "vm-message");
+        } else {
+                res = ast_play_and_wait(chan, "vm-youhave");
+        }
+        if (!res) {
+                if (vms->newmessages) {
+                        if (!res) {
+                                if ((vms->newmessages == 1)) {
+                                        res = ast_play_and_wait(chan, "digits/un");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-message");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-nuovo");
+                                } else {
+                                        res = say_and_wait(chan, vms->newmessages, chan->language);
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-messages");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-nuovi");
+                                }
+                        }
+                        if (vms->oldmessages && !res)
+                                res = ast_play_and_wait(chan, "vm-and");
+                }
+                if (vms->oldmessages) {
+                        if (!res) {
+                                if (vms->oldmessages == 1) {
+                                        res = ast_play_and_wait(chan, "digits/un");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-message");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-vecchio");
+                                } else {
+                                        res = say_and_wait(chan, vms->oldmessages, chan->language);
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-messages");
+                                        if (!res)
+                                                res = ast_play_and_wait(chan, "vm-vecchi");
+                                }
+                        }
+                }
+        }
+	return res;
+}
+
 /* GERMAN syntax */
 static int vm_intro_de(struct ast_channel *chan,struct vm_state *vms)
 {
@@ -3046,6 +3099,8 @@
 		return vm_intro_de(chan, vms);
 	} else if (!strcasecmp(chan->language, "es")) { /* SPANISH syntax */
 		return vm_intro_es(chan, vms);
+	} else if (!strcasecmp(chan->language, "it")) { /* ITALIAN syntax */
+		return vm_intro_it(chan, vms);
 	} else if (!strcasecmp(chan->language, "fr")) {	/* FRENCH syntax */
 		return vm_intro_fr(chan, vms);
 	} else if (!strcasecmp(chan->language, "nl")) {	/* DUTCH syntax */

--i3lJ51RuaGWuFYNw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="vm_password_cmd.dpatch"

#! /bin/sh /usr/share/dpatch/dpatch-run
## vm_password_cmd.dpatch by Xorcom Ltd. (software releases key) <support@xorcom.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: When using an external script for setting the password, change the 
## DP: current password app_voicemail knows as well. 

@DPATCH@
diff -urNad asterisk-1.0.8.dfsg.1/apps/app_voicemail.c /tmp/dpep.KU2tuq/asterisk-1.0.8.dfsg.1/apps/app_voicemail.c
--- asterisk-1.0.8.dfsg.1/apps/app_voicemail.c	2005-06-26 00:24:13.000000000 +0300
+++ /tmp/dpep.KU2tuq/asterisk-1.0.8.dfsg.1/apps/app_voicemail.c	2005-06-26 00:26:17.000000000 +0300
@@ -3172,10 +3172,10 @@
 				cmd = ast_play_and_wait(chan, "vm-mismatch");
 				break;
 			}
-			if(ast_strlen_zero(ext_pass_cmd)) 
-				vm_change_password(vmu,newpassword);
-			else 
+			vm_change_password(vmu,newpassword);
+			if(! ast_strlen_zero(ext_pass_cmd)) {
 				vm_change_password_shell(vmu,newpassword);
+			}
 			ast_log(LOG_DEBUG,"User %s set password to %s of length %i\n",vms->username,newpassword,(int)strlen(newpassword));
 			cmd = ast_play_and_wait(chan,"vm-passchanged");
 			break;

--i3lJ51RuaGWuFYNw--




More information about the Pkg-voip-maintainers mailing list