[asterisk-commits] branch murf/AEL2 r9189 - in /team/murf/AEL2: ./ apps/ channels/ channels/misd...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Feb 7 07:44:59 MST 2006


Author: murf
Date: Tue Feb  7 08:44:51 2006
New Revision: 9189

URL: http://svn.digium.com/view/asterisk?rev=9189&view=rev
Log:
Merged revisions 8232,8242,8276,8281,8320,8347,8394,8412,8414,8418 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r8232 | russell | 2006-01-18 21:17:45 -0700 (Wed, 18 Jan 2006) | 3 lines

fix a seg fault due to assuming that space gets allocatted on the stack in the
same order that we declare the variables (issue #6290)

........
r8242 | russell | 2006-01-18 21:56:48 -0700 (Wed, 18 Jan 2006) | 3 lines

fix Message-Account header to use the ip address if the fromdomain 
isn't set (issue #6278)

........
r8276 | tilghman | 2006-01-19 12:14:37 -0700 (Thu, 19 Jan 2006) | 2 lines

Bug 6072 - Memory leaks in the expression parser

........
r8281 | oej | 2006-01-19 12:40:28 -0700 (Thu, 19 Jan 2006) | 2 lines

Enable "musicclass" setting for sip peers as per the config sample.

........
r8320 | mogorman | 2006-01-19 18:00:46 -0700 (Thu, 19 Jan 2006) | 3 lines

solved problem with delayreject and iax trunking
bug 4291

........
r8347 | russell | 2006-01-20 11:34:42 -0700 (Fri, 20 Jan 2006) | 2 lines

fix invalid value of prev_q (issue #6302)

........
r8394 | tilghman | 2006-01-21 11:29:39 -0700 (Sat, 21 Jan 2006) | 2 lines

Bug 5936 - AddQueueMember fails on realtime queue, if queue not yet loaded

........
r8412 | russell | 2006-01-21 16:17:06 -0700 (Sat, 21 Jan 2006) | 2 lines

prevent the possibility of writing outside of the available workspace (issue #6271)

........
r8414 | russell | 2006-01-21 16:43:14 -0700 (Sat, 21 Jan 2006) | 2 lines

temporarily revert substring fix pending the result of the discussion in issue #6271

........
r8418 | russell | 2006-01-21 19:05:41 -0700 (Sat, 21 Jan 2006) | 3 lines

add a modified fix to prevent writing outside of the provided workspace when 
calculating a substring (issue #6271)

........

Added:
    team/murf/AEL2/funcs/func_sha1.c
      - copied unchanged from r9186, trunk/funcs/func_sha1.c
    team/murf/AEL2/include/asterisk/sha1.h
      - copied unchanged from r9186, trunk/include/asterisk/sha1.h
    team/murf/AEL2/sha1.c
      - copied unchanged from r9186, trunk/sha1.c
Modified:
    team/murf/AEL2/   (props changed)
    team/murf/AEL2/Makefile
    team/murf/AEL2/apps/app_macro.c
    team/murf/AEL2/channel.c
    team/murf/AEL2/channels/chan_local.c
    team/murf/AEL2/channels/chan_misdn_config.c
    team/murf/AEL2/channels/misdn/Makefile
    team/murf/AEL2/configs/misdn.conf.sample
    team/murf/AEL2/funcs/Makefile
    team/murf/AEL2/include/asterisk/utils.h
    team/murf/AEL2/utils.c

Propchange: team/murf/AEL2/
------------------------------------------------------------------------------
--- branch-1.2-blocked (added)
+++ branch-1.2-blocked Tue Feb  7 08:44:51 2006
@@ -1,0 +1,1 @@
+/branches/1.2:7490,7497,7517,7529,7546,7550,7552,7557,7580,7586,7595,7605,7641,7663,7706,7738,7771,7792,7812,7870-7871,7898-7900,7915,7960,7965,7970,7976,8047,8112,8124,8134,8394,8412,8414,8418,8429,8433,8445,8562,8573,8600,8619,8666,8808,9073

Propchange: team/murf/AEL2/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/murf/AEL2/
            ('svnmerge-blocked' removed)

Propchange: team/murf/AEL2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Feb  7 08:44:51 2006
@@ -1,1 +1,1 @@
-/trunk:1-9129
+/trunk:1-9186

Modified: team/murf/AEL2/Makefile
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2/Makefile?rev=9189&r1=9188&r2=9189&view=diff
==============================================================================
--- team/murf/AEL2/Makefile (original)
+++ team/murf/AEL2/Makefile Tue Feb  7 08:44:51 2006
@@ -3,7 +3,7 @@
 # 
 # Top level Makefile
 #
-# Copyright (C) 1999-2005, Mark Spencer
+# Copyright (C) 1999-2006, Digium, Inc.
 #
 # Mark Spencer <markster at digium.com>
 #
@@ -349,7 +349,7 @@
 	astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
 	utils.o plc.o jitterbuf.o dnsmgr.o devicestate.o \
 	netsock.o slinfactory.o ast_expr2.o ast_expr2f.o \
-	cryptostub.o
+	cryptostub.o sha1.o
 
 ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sys/poll.h),)
   OBJS+= poll.o
@@ -943,4 +943,4 @@
 	rm -rf $(DESTDIR)$(ASTSPOOLDIR)
 	rm -rf $(DESTDIR)$(ASTETCDIR)
 	rm -rf $(DESTDIR)$(ASTLOGDIR)
-	
+

Modified: team/murf/AEL2/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2/apps/app_macro.c?rev=9189&r1=9188&r2=9189&view=diff
==============================================================================
--- team/murf/AEL2/apps/app_macro.c (original)
+++ team/murf/AEL2/apps/app_macro.c Tue Feb  7 08:44:51 2006
@@ -107,7 +107,7 @@
 	char oldcontext[AST_MAX_CONTEXT] = "";
 	int offset, depth = 0;
 	int setmacrocontext=0;
-	int autoloopflag;
+	int autoloopflag, dead = 0;
   
 	char *save_macro_exten;
 	char *save_macro_context;
@@ -208,8 +208,8 @@
 				break;
 			}
 			switch(res) {
-	        	case MACRO_EXIT_RESULT:
-                        	res = 0;
+			case MACRO_EXIT_RESULT:
+				res = 0;
 				goto out;
 			case AST_PBX_KEEPALIVE:
 				if (option_debug)
@@ -223,6 +223,7 @@
 					ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
 				else if (option_verbose > 1)
 					ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
+				dead = 1;
 				goto out;
 			}
 		}
@@ -242,37 +243,44 @@
 	out:
 	/* Reset the depth back to what it was when the routine was entered (like if we called Macro recursively) */
 	snprintf(depthc, sizeof(depthc), "%d", depth);
-	pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
-
-	ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
-  	for (x=1; x<argc; x++) {
+	if (!dead) {
+		pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
+
+		ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
+	}
+
+  	for (x = 1; x < argc; x++) {
   		/* Restore old arguments and delete ours */
 		snprintf(varname, sizeof(varname), "ARG%d", x);
   		if (oldargs[x]) {
-			pbx_builtin_setvar_helper(chan, varname, oldargs[x]);
+			if (!dead)
+				pbx_builtin_setvar_helper(chan, varname, oldargs[x]);
 			free(oldargs[x]);
-		} else {
+		} else if (!dead) {
 			pbx_builtin_setvar_helper(chan, varname, NULL);
 		}
   	}
 
 	/* Restore macro variables */
-	pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);
+	if (!dead) {
+		pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);
+		pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", save_macro_context);
+		pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);
+	}
 	if (save_macro_exten)
 		free(save_macro_exten);
-	pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", save_macro_context);
 	if (save_macro_context)
 		free(save_macro_context);
-	pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);
 	if (save_macro_priority)
 		free(save_macro_priority);
-	if (setmacrocontext) {
+
+	if (!dead && setmacrocontext) {
 		chan->macrocontext[0] = '\0';
 		chan->macroexten[0] = '\0';
 		chan->macropriority = 0;
 	}
 
-	if (!strcasecmp(chan->context, fullmacro)) {
+	if (!dead && !strcasecmp(chan->context, fullmacro)) {
   		/* If we're leaving the macro normally, restore original information */
 		chan->priority = oldpriority;
 		ast_copy_string(chan->context, oldcontext, sizeof(chan->context));
@@ -292,7 +300,8 @@
 		}
 	}
 
-	pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
+	if (!dead)
+		pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
 	if (save_macro_offset)
 		free(save_macro_offset);
 	LOCAL_USER_REMOVE(u);

Modified: team/murf/AEL2/channel.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2/channel.c?rev=9189&r1=9188&r2=9189&view=diff
==============================================================================
--- team/murf/AEL2/channel.c (original)
+++ team/murf/AEL2/channel.c Tue Feb  7 08:44:51 2006
@@ -72,6 +72,7 @@
 #include "asterisk/app.h"
 #include "asterisk/transcap.h"
 #include "asterisk/devicestate.h"
+#include "asterisk/sha1.h"
 
 struct channel_spy_trans {
 	int last_format;

Modified: team/murf/AEL2/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2/channels/chan_local.c?rev=9189&r1=9188&r2=9189&view=diff
==============================================================================
--- team/murf/AEL2/channels/chan_local.c (original)
+++ team/murf/AEL2/channels/chan_local.c Tue Feb  7 08:44:51 2006
@@ -394,7 +394,7 @@
 	isoutbound = IS_OUTBOUND(ast, p);
 	if (isoutbound) {
 		status = pbx_builtin_getvar_helper(p->chan, "DIALSTATUS");
-		if(status)
+		if ((status) && (p->owner))
 			pbx_builtin_setvar_helper(p->owner, "CHANLOCALSTATUS", status);
 		p->chan = NULL;
 		p->launchedpbx = 0;

Modified: team/murf/AEL2/channels/chan_misdn_config.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2/channels/chan_misdn_config.c?rev=9189&r1=9188&r2=9189&view=diff
==============================================================================
--- team/murf/AEL2/channels/chan_misdn_config.c (original)
+++ team/murf/AEL2/channels/chan_misdn_config.c Tue Feb  7 08:44:51 2006
@@ -107,8 +107,8 @@
 	{ "echocancelwhenbridged", MISDN_CFG_ECHOCANCELWHENBRIDGED, MISDN_CTYPE_BOOL, "no", NONE },
 	{ "echotraining", MISDN_CFG_ECHOTRAINING, MISDN_CTYPE_BOOLINT, "1", 1 },
 	{ "need_more_infos", MISDN_CFG_NEED_MORE_INFOS, MISDN_CTYPE_BOOL, "0", NONE },
-	{ "jitterbuffer", MISDN_CFG_JITTERBUFFER, MISDN_CTYPE_INT, "0", NONE },
-	{ "jitterbuffer_upper_threshold", MISDN_CFG_JITTERBUFFER_UPPER_THRESHOLD, MISDN_CTYPE_INT, "0", NONE },
+	{ "jitterbuffer", MISDN_CFG_JITTERBUFFER, MISDN_CTYPE_INT, "1000", NONE },
+	{ "jitterbuffer_upper_threshold", MISDN_CFG_JITTERBUFFER_UPPER_THRESHOLD, MISDN_CTYPE_INT, "600", NONE },
 	{ "callgroup", MISDN_CFG_CALLGROUP, MISDN_CTYPE_ASTGROUP, NO_DEFAULT, NONE },
 	{ "pickupgroup", MISDN_CFG_PICKUPGROUP, MISDN_CTYPE_ASTGROUP, NO_DEFAULT, NONE },
 	{ "msns", MISDN_CFG_MSNS, MISDN_CTYPE_MSNLIST, NO_DEFAULT, NONE }

Modified: team/murf/AEL2/channels/misdn/Makefile
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2/channels/misdn/Makefile?rev=9189&r1=9188&r2=9189&view=diff
==============================================================================
--- team/murf/AEL2/channels/misdn/Makefile (original)
+++ team/murf/AEL2/channels/misdn/Makefile Tue Feb  7 08:44:51 2006
@@ -6,7 +6,7 @@
 
 # Verify those options with main Makefile
 CFLAGS		= -pipe -c -Wall
-ifeq ($(PROC),x86_64)
+ifeq ($(shell uname -m),x86_64)
 CFLAGS	       += -fPIC
 endif
 SOURCES		= isdn_lib.c isdn_msg_parser.c 

Modified: team/murf/AEL2/configs/misdn.conf.sample
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2/configs/misdn.conf.sample?rev=9189&r1=9188&r2=9189&view=diff
==============================================================================
--- team/murf/AEL2/configs/misdn.conf.sample (original)
+++ team/murf/AEL2/configs/misdn.conf.sample Tue Feb  7 08:44:51 2006
@@ -258,7 +258,7 @@
 ;
 ; change this threshold to enable dejitter functionality
 ;
-jitterbuffer_upper_threshold=0
+jitterbuffer_upper_threshold=600
 
 
 [intern]

Modified: team/murf/AEL2/funcs/Makefile
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2/funcs/Makefile?rev=9189&r1=9188&r2=9189&view=diff
==============================================================================
--- team/murf/AEL2/funcs/Makefile (original)
+++ team/murf/AEL2/funcs/Makefile Tue Feb  7 08:44:51 2006
@@ -24,7 +24,8 @@
          func_timeout.o \
          func_language.o \
          func_moh.o \
-         func_base64.o
+         func_base64.o \
+         func_sha1.o
 
 AVAILABLE_FUNCS=$(filter-out $(BUILTINS),$(patsubst %.c,%.o,$(wildcard func*.c)))
 

Modified: team/murf/AEL2/include/asterisk/utils.h
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2/include/asterisk/utils.h?rev=9189&r1=9188&r2=9189&view=diff
==============================================================================
--- team/murf/AEL2/include/asterisk/utils.h (original)
+++ team/murf/AEL2/include/asterisk/utils.h Tue Feb  7 08:44:51 2006
@@ -145,6 +145,9 @@
 /* ast_md5_hash 
 	\brief Produces MD5 hash based on input string */
 void ast_md5_hash(char *output, char *input);
+/* ast_sha1_hash
+	\brief Produces SHA1 hash based on input string */
+void ast_sha1_hash(char *output, char *input);
 
 int ast_base64encode(char *dst, const unsigned char *src, int srclen, int max);
 int ast_base64decode(unsigned char *dst, const char *src, int max);

Modified: team/murf/AEL2/utils.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2/utils.c?rev=9189&r1=9188&r2=9189&view=diff
==============================================================================
--- team/murf/AEL2/utils.c (original)
+++ team/murf/AEL2/utils.c Tue Feb  7 08:44:51 2006
@@ -43,6 +43,7 @@
 #include "asterisk/io.h"
 #include "asterisk/logger.h"
 #include "asterisk/md5.h"
+#include "asterisk/sha1.h"
 #include "asterisk/options.h"
 #include "asterisk/compat.h"
 
@@ -281,7 +282,7 @@
 	return(test_errors);          /* return 0 on success. */
 }
 
-/*! \brief ast_md5_hash: Produce 16 char MD5 hash of value. ---*/
+/*! \brief ast_md5_hash: Produce 32 char MD5 hash of value. ---*/
 void ast_md5_hash(char *output, char *input)
 {
 	struct MD5Context md5;
@@ -295,6 +296,24 @@
 	ptr = output;
 	for (x=0; x<16; x++)
 		ptr += sprintf(ptr, "%2.2x", digest[x]);
+}
+
+/*! \brief ast_sha1_hash: Produce 40 char SHA1 hash of value. ---*/
+void ast_sha1_hash(char *output, char *input)
+{
+	struct SHA1Context sha;
+	char *ptr;
+	int x;
+	uint8_t Message_Digest[20];
+
+	SHA1Reset(&sha);
+	
+	SHA1Input(&sha, (const unsigned char *) input, strlen(input));
+
+	SHA1Result(&sha, Message_Digest);
+	ptr = output;
+	for (x = 0; x < 20; x++)
+		ptr += sprintf(ptr, "%2.2x", Message_Digest[x]);
 }
 
 int ast_base64decode(unsigned char *dst, const char *src, int max)



More information about the asterisk-commits mailing list