[asterisk-commits] branch oej/jitterbuffer r13785 - in /team/oej/jitterbuffer: ./ agi/ apps/ cha...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Mar 21 01:51:19 MST 2006


Author: oej
Date: Tue Mar 21 02:51:04 2006
New Revision: 13785

URL: http://svn.digium.com/view/asterisk?rev=13785&view=rev
Log:
Reset automerge

Modified:
    team/oej/jitterbuffer/   (props changed)
    team/oej/jitterbuffer/agi/Makefile
    team/oej/jitterbuffer/apps/app_meetme.c
    team/oej/jitterbuffer/apps/app_voicemail.c
    team/oej/jitterbuffer/astmm.c
    team/oej/jitterbuffer/channel.c
    team/oej/jitterbuffer/channels/chan_iax2.c
    team/oej/jitterbuffer/channels/chan_misdn.c
    team/oej/jitterbuffer/channels/misdn/chan_misdn_config.h
    team/oej/jitterbuffer/channels/misdn/isdn_lib.c
    team/oej/jitterbuffer/channels/misdn_config.c
    team/oej/jitterbuffer/codecs/gsm/libgsm.vcproj   (props changed)
    team/oej/jitterbuffer/codecs/ilbc/libilbc.vcproj   (props changed)
    team/oej/jitterbuffer/codecs/lpc10/liblpc10.vcproj   (props changed)
    team/oej/jitterbuffer/configs/indications.conf.sample
    team/oej/jitterbuffer/configs/misdn.conf.sample
    team/oej/jitterbuffer/db.c
    team/oej/jitterbuffer/editline/term.c
    team/oej/jitterbuffer/funcs/func_enum.c
    team/oej/jitterbuffer/image.c
    team/oej/jitterbuffer/include/asterisk/channel.h
    team/oej/jitterbuffer/include/solaris-compat/compat.h
    team/oej/jitterbuffer/pbx.c
    team/oej/jitterbuffer/strcompat.c

Propchange: team/oej/jitterbuffer/
------------------------------------------------------------------------------
    automerge = http://edvina.net/training/

Propchange: team/oej/jitterbuffer/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/oej/jitterbuffer/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Mar 21 02:51:04 2006
@@ -1,1 +1,1 @@
-/trunk:1-13597
+/trunk:1-13784

Modified: team/oej/jitterbuffer/agi/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/agi/Makefile?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/agi/Makefile (original)
+++ team/oej/jitterbuffer/agi/Makefile Tue Mar 21 02:51:04 2006
@@ -13,7 +13,7 @@
 
 AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi
 
-CFLAGS+=
+CFLAGS+=-DNO_AST_MM
 
 LIBS=
 ifeq ($(OSARCH),SunOS)

Modified: team/oej/jitterbuffer/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/apps/app_meetme.c?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/apps/app_meetme.c (original)
+++ team/oej/jitterbuffer/apps/app_meetme.c Tue Mar 21 02:51:04 2006
@@ -1830,28 +1830,20 @@
 				ast_log(LOG_WARNING, "No %s file :(\n", CONFIG_FILE_NAME);
 				return NULL;
 			}
-			var = ast_variable_browse(cfg, "rooms");
-			for (; var; var = var->next) {
+			for (var = ast_variable_browse(cfg, "rooms"); var; var = var->next) {
 				if (strcasecmp(var->name, "conf"))
 					continue;
 				
 				if (!(parse = ast_strdupa(var->value)))
 					return NULL;
 				
-				AST_STANDARD_APP_ARGS(args, parse);
+				AST_NONSTANDARD_APP_ARGS(args, parse, ',');
 				if (!strcasecmp(args.confno, confno)) {
 					/* Bingo it's a valid conference */
-					if (args.pin) {
-						if (args.pinadmin)
-							cnf = build_conf(args.confno, args.pin, args.pinadmin, make, dynamic, refcount);
-						else
-							cnf = build_conf(args.confno, args.pin, "", make, dynamic, refcount);
-					} else {
-						if (args.pinadmin)
-							cnf = build_conf(args.confno, "", args.pinadmin, make, dynamic, refcount);
-						else
-							cnf = build_conf(args.confno, "", "", make, dynamic, refcount);
-					}
+					cnf = build_conf(args.confno,
+							ast_strlen_zero(args.pin) ? "" : args.pin,
+							ast_strlen_zero(args.pinadmin) ? "" : args.pinadmin,
+							make, dynamic, refcount);
 					break;
 				}
 			}
@@ -2026,7 +2018,7 @@
 									AST_LIST_UNLOCK(&confs);
 									if (!found) {
 										/* At this point, we have a confno_tmp (static conference) that is empty */
-										if ((empty_no_pin && ((!stringp) || (stringp && (stringp[0] == '\0')))) || (!empty_no_pin)) {
+										if ((empty_no_pin && ast_strlen_zero(stringp)) || (!empty_no_pin)) {
 											/* Case 1:  empty_no_pin and pin is nonexistent (NULL)
 											 * Case 2:  empty_no_pin and pin is blank (but not NULL)
 											 * Case 3:  not empty_no_pin

Modified: team/oej/jitterbuffer/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/apps/app_voicemail.c?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/apps/app_voicemail.c (original)
+++ team/oej/jitterbuffer/apps/app_voicemail.c Tue Mar 21 02:51:04 2006
@@ -2364,7 +2364,7 @@
 
 static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_options *options)
 {
-	char txtfile[256];
+	char tmptxtfile[256], txtfile[256];
 	char callerid[256];
 	FILE *txt;
 	int res = 0;
@@ -2561,7 +2561,8 @@
 				
 			/* Store information */
 			snprintf(txtfile, sizeof(txtfile), "%s.txt", fn);
-			txt = fopen(txtfile, "w+");
+			snprintf(tmptxtfile, sizeof(tmptxtfile), "%s.txt.tmp", fn);
+			txt = fopen(tmptxtfile, "w+");
 			if (txt) {
 				get_date(date, sizeof(date));
 				fprintf(txt, 
@@ -2601,6 +2602,7 @@
 			if (txt) {
 				fprintf(txt, "duration=%d\n", duration);
 				fclose(txt);
+				rename(tmptxtfile, txtfile);
 			}
 				
 			if (duration < vmminmessage) {

Modified: team/oej/jitterbuffer/astmm.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/astmm.c?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/astmm.c (original)
+++ team/oej/jitterbuffer/astmm.c Tue Mar 21 02:51:04 2006
@@ -38,6 +38,7 @@
 #include "asterisk/options.h"
 #include "asterisk/lock.h"
 #include "asterisk/strings.h"
+#include "asterisk/unaligned.h"
 
 #define SOME_PRIME 563
 
@@ -104,7 +105,7 @@
 		regions[hash] = reg;
 		reg->fence = FENCE_MAGIC;
 		fence = (ptr + reg->len);
-		*fence = FENCE_MAGIC;
+		put_unaligned_uint32(fence, FENCE_MAGIC);
 	}
 	ast_mutex_unlock(&reglock);
 	if (!reg) {
@@ -166,7 +167,7 @@
 				fflush(mmlog);
 			}
 		}
-		if (*fence != FENCE_MAGIC) {
+		if (get_unaligned_uint32(fence) != FENCE_MAGIC) {
 			fprintf(stderr, "WARNING: High fence violation at %p, in %s of %s, line %d\n", reg->data, reg->func, reg->file, reg->lineno);
 			if (mmlog) {
 				fprintf(mmlog, "%ld - WARNING: High fence violation at %p, in %s of %s, line %d\n", time(NULL), reg->data, reg->func, reg->file, reg->lineno);
@@ -316,7 +317,7 @@
 						fflush(mmlog);
 					}
 				}
-				if (*fence != FENCE_MAGIC) {
+				if (get_unaligned_uint32(fence) != FENCE_MAGIC) {
 					fprintf(stderr, "WARNING: High fence violation at %p, in %s of %s, line %d\n", reg->data, reg->func, reg->file, reg->lineno);
 					if (mmlog) {
 						fprintf(mmlog, "%ld - WARNING: High fence violation at %p, in %s of %s, line %d\n", time(NULL), reg->data, reg->func, reg->file, reg->lineno);

Modified: team/oej/jitterbuffer/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/channel.c?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/channel.c (original)
+++ team/oej/jitterbuffer/channel.c Tue Mar 21 02:51:04 2006
@@ -1011,6 +1011,7 @@
 	ast_jb_destroy(chan);
 #endif /* AST_JB */
 
+	ast_string_field_free_all(chan);
 	free(chan);
 	AST_LIST_UNLOCK(&channels);
 

Modified: team/oej/jitterbuffer/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/channels/chan_iax2.c?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/channels/chan_iax2.c (original)
+++ team/oej/jitterbuffer/channels/chan_iax2.c Tue Mar 21 02:51:04 2006
@@ -5040,7 +5040,8 @@
 				ast_copy_string(iaxs[callno]->cid_name, user->cid_name, sizeof(iaxs[callno]->cid_name));
 				iaxs[callno]->calling_pres = AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN;
 			}
-			ast_copy_string(iaxs[callno]->ani, user->cid_num, sizeof(iaxs[callno]->ani));
+			if (ast_strlen_zero(iaxs[callno]->ani))
+				ast_copy_string(iaxs[callno]->ani, user->cid_num, sizeof(iaxs[callno]->ani));
 		} else {
 			iaxs[callno]->calling_pres = AST_PRES_NUMBER_NOT_AVAILABLE;
 		}

Modified: team/oej/jitterbuffer/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/channels/chan_misdn.c?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/channels/chan_misdn.c (original)
+++ team/oej/jitterbuffer/channels/chan_misdn.c Tue Mar 21 02:51:04 2006
@@ -1105,6 +1105,21 @@
 	
 	chan_misdn_log(1,port,"update_config: Getting Config\n");
 
+
+	int hdlc=0;
+	misdn_cfg_get( port, MISDN_CFG_HDLC, &hdlc, sizeof(int));
+	
+	if (hdlc) {
+		switch (bc->capability) {
+		case INFO_CAPABILITY_DIGITAL_UNRESTRICTED:
+		case INFO_CAPABILITY_DIGITAL_RESTRICTED:
+			chan_misdn_log(1,bc->port," --> CONF HDLC\n");
+			bc->hdlc=1;
+			break;
+		}
+		
+	}
+	
 	
 	int pres, screen;
 			
@@ -1244,7 +1259,19 @@
 
 	misdn_cfg_get( port, MISDN_CFG_NEED_MORE_INFOS, &bc->need_more_infos, sizeof(int));
 	
-
+	int hdlc=0;
+	misdn_cfg_get( port, MISDN_CFG_HDLC, &hdlc, sizeof(int));
+	
+	if (hdlc) {
+		switch (bc->capability) {
+		case INFO_CAPABILITY_DIGITAL_UNRESTRICTED:
+		case INFO_CAPABILITY_DIGITAL_RESTRICTED:
+			chan_misdn_log(1,bc->port," --> CONF HDLC\n");
+			bc->hdlc=1;
+			break;
+		}
+		
+	}
 	/*Initialize new Jitterbuffer*/
 	{
 		misdn_cfg_get( port, MISDN_CFG_JITTERBUFFER, &ch->jb_len, sizeof(int));
@@ -1573,7 +1600,7 @@
 
 		/* update screening and presentation */ 
 		update_config(ch,ORG_AST);
-
+		
 		/* fill in some ies from channel vary*/
 		import_ies(ast, newbc);
 		

Modified: team/oej/jitterbuffer/channels/misdn/chan_misdn_config.h
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/channels/misdn/chan_misdn_config.h?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/channels/misdn/chan_misdn_config.h (original)
+++ team/oej/jitterbuffer/channels/misdn/chan_misdn_config.h Tue Mar 21 02:51:04 2006
@@ -27,6 +27,7 @@
 	MISDN_CFG_TXGAIN,              /* int */
 	MISDN_CFG_TE_CHOOSE_CHANNEL,   /* int (bool) */
 	MISDN_CFG_PMP_L1_CHECK,        /* int (bool) */
+	MISDN_CFG_HDLC,                /* int (bool) */
 	MISDN_CFG_CONTEXT,             /* char[] */
 	MISDN_CFG_LANGUAGE,            /* char[] */
 	MISDN_CFG_MUSICCLASS,            /* char[] */

Modified: team/oej/jitterbuffer/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/channels/misdn/isdn_lib.c?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/channels/misdn/isdn_lib.c (original)
+++ team/oej/jitterbuffer/channels/misdn/isdn_lib.c Tue Mar 21 02:51:04 2006
@@ -818,9 +818,11 @@
 	int channel=bc->channel-1-(bc->channel>16);
 	int b_stid=stack->b_stids[channel>=0?channel:0];
 
+#if 0
 	if (bc->hdlc) {
 		clean_up_bc(bc);
 	}
+#endif
 	
 	if (bc->upset) {
 		cb_log(4, stack->port, "$$$ bc already upsetted stid :%x\n", b_stid);
@@ -946,9 +948,7 @@
 	
 	bc->upset=1;
 	
-	
 	manager_bchannel_deactivate(bc);
-	
 	return 0;
 }
 

Modified: team/oej/jitterbuffer/channels/misdn_config.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/channels/misdn_config.c?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/channels/misdn_config.c (original)
+++ team/oej/jitterbuffer/channels/misdn_config.c Tue Mar 21 02:51:04 2006
@@ -88,6 +88,7 @@
 	{ "txgain", MISDN_CFG_TXGAIN, MISDN_CTYPE_INT, "0", NONE },
 	{ "te_choose_channel", MISDN_CFG_TE_CHOOSE_CHANNEL, MISDN_CTYPE_BOOL, "no", NONE },
 	{ "pmp_l1_check", MISDN_CFG_PMP_L1_CHECK, MISDN_CTYPE_BOOL, "yes", NONE },
+	{ "hdlc", MISDN_CFG_HDLC, MISDN_CTYPE_BOOL, "no", NONE },
 	{ "context", MISDN_CFG_CONTEXT, MISDN_CTYPE_STR, "default", NONE },
 	{ "language", MISDN_CFG_LANGUAGE, MISDN_CTYPE_STR, "en", NONE },
 	{ "musicclass", MISDN_CFG_MUSICCLASS, MISDN_CTYPE_STR, "default", NONE },

Propchange: team/oej/jitterbuffer/codecs/gsm/libgsm.vcproj
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/oej/jitterbuffer/codecs/ilbc/libilbc.vcproj
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/oej/jitterbuffer/codecs/lpc10/liblpc10.vcproj
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: team/oej/jitterbuffer/configs/indications.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/configs/indications.conf.sample?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/configs/indications.conf.sample (original)
+++ team/oej/jitterbuffer/configs/indications.conf.sample Tue Mar 21 02:51:04 2006
@@ -376,6 +376,14 @@
 info = 950/330,0/30,1400/330,0/30,1800/330,0/1000
 stutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
 
+[my]
+description = Malaysia
+ringcadence = 2000,4000
+dial = 425
+busy = 425/500,0/500
+ring = 425/400,0/200
+congestion = 425/500,0/500
+
 [nl]
 description = Netherlands
 ; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf

Modified: team/oej/jitterbuffer/configs/misdn.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/configs/misdn.conf.sample?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/configs/misdn.conf.sample (original)
+++ team/oej/jitterbuffer/configs/misdn.conf.sample Tue Mar 21 02:51:04 2006
@@ -31,15 +31,6 @@
 ;
 ;tracefile=/var/log/misdn.trace
 
-; single call trace files
-; set to true if you want to have them
-; they depend on debug level
-;
-; default values: trace_calls : false
-;                 trace_dir   : /var/log/
-;
-trace_calls=false
-trace_dir=/var/log/
 
 ; set to yes if you want mISDN_dsp to bridge the calls in HW
 ;
@@ -295,6 +286,12 @@
 ;
 jitterbuffer_upper_threshold=0
 
+
+;
+; change this to yes, if you want to bridge a mISDN data channel to 
+; another channel type or to an application.
+;
+hdlc=no
 
 [intern]
 ; define your ports, e.g. 1,2 (depends on mISDN-driver loading order) 

Modified: team/oej/jitterbuffer/db.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/db.c?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/db.c (original)
+++ team/oej/jitterbuffer/db.c Tue Mar 21 02:51:04 2006
@@ -520,15 +520,15 @@
 	char *val = astman_get_header(m, "Val");
 	int res;
 
-	if (!strlen(family)) {
+	if (ast_strlen_zero(family)) {
 		astman_send_error(s, m, "No family specified");
 		return 0;
 	}
-	if (!strlen(key)) {
+	if (ast_strlen_zero(key)) {
 		astman_send_error(s, m, "No key specified");
 		return 0;
 	}
-	if (!strlen(val)) {
+	if (ast_strlen_zero(val)) {
 		astman_send_error(s, m, "No val specified");
 		return 0;
 	}
@@ -551,11 +551,11 @@
 	char tmp[256];
 	int res;
 
-	if (!strlen(family)) {
+	if (ast_strlen_zero(family)) {
 		astman_send_error(s, m, "No family specified.");
 		return 0;
 	}
-	if (!strlen(key)) {
+	if (ast_strlen_zero(key)) {
 		astman_send_error(s, m, "No key specified.");
 		return 0;
 	}

Modified: team/oej/jitterbuffer/editline/term.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/editline/term.c?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/editline/term.c (original)
+++ team/oej/jitterbuffer/editline/term.c Tue Mar 21 02:51:04 2006
@@ -64,10 +64,16 @@
 #ifdef HAVE_NCURSES_H
 #include <ncurses.h>
 #endif
-/* Solaris's term.h does horrid things. */
-#if (defined(HAVE_TERM_H) && !defined(SUNOS))
-#include <term.h>
-#endif
+#if defined(HAVE_TERM_H)
+#include "term.h"
+/* Can not use /usr/include/term.h because of a lot of incompatibilities, so just define some prototypes */
+extern int tgetent(char *, const char *);
+extern int tgetflag(const char *);
+extern int tgetnum(const char *);
+extern char *tgetstr(const char *, char **);
+extern int tputs (const char *, int, int (*)(int));
+extern char *tgoto (const char *, int, int);
+#endif /* defined(HAVE_TERM_H) */
 #include <sys/types.h>
 #include <sys/ioctl.h>
 
@@ -1190,15 +1196,15 @@
 		if (p && *p) {
 			j = (unsigned char) *p;
 			/*
-		         * Assign the arrow keys only if:
-		         *
-		         * 1. They are multi-character arrow keys and the user
-		         *    has not re-assigned the leading character, or
-		         *    has re-assigned the leading character to be
-		         *	  ED_SEQUENCE_LEAD_IN
-		         * 2. They are single arrow keys pointing to an
+			 * Assign the arrow keys only if:
+			 *
+			 * 1. They are multi-character arrow keys and the user
+			 *    has not re-assigned the leading character, or
+			 *    has re-assigned the leading character to be
+			 *	  ED_SEQUENCE_LEAD_IN
+			 * 2. They are single arrow keys pointing to an
 			 *    unassigned key.
-		         */
+			 */
 			if (arrow[i].type == XK_NOD)
 				key_clear(el, map, p);
 			else {

Modified: team/oej/jitterbuffer/funcs/func_enum.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/funcs/func_enum.c?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/funcs/func_enum.c (original)
+++ team/oej/jitterbuffer/funcs/func_enum.c Tue Mar 21 02:51:04 2006
@@ -64,7 +64,7 @@
 	);
 	int res = 0;
 	char tech[80];
-	char dest[256] = "";
+	char dest[256] = "", tmp[2] = "", num[AST_MAX_EXTENSION] = "";
 	struct localuser *u;
 	char *s, *p;
 
@@ -82,6 +82,8 @@
 		return -1;
 	}
 
+	LOCAL_USER_ADD(u);
+
 	ast_copy_string(tech, args.tech ? args.tech : "sip", sizeof(tech));
 
 	if (!args.zone)
@@ -92,23 +94,23 @@
 
 	/* strip any '-' signs from number */
 	for (s = p = args.number; *s; s++) {
-		if (*s != '-')
-			*p++ = *s;
-	}
-	*p = '\0';
-
-	LOCAL_USER_ADD(u);
-
-	res = ast_get_enum(chan, p, dest, sizeof(dest), tech, sizeof(tech), args.zone,
+		if (*s != '-') {
+			snprintf(tmp, sizeof(tmp), "%c", *s);
+			strncat(num, tmp, sizeof(num));
+		}
+
+	}
+
+	res = ast_get_enum(chan, num, dest, sizeof(dest), tech, sizeof(tech), args.zone,
 			   args.options);
-
-	LOCAL_USER_REMOVE(u);
 
 	p = strchr(dest, ':');
 	if (p && strcasecmp(tech, "ALL"))
 		ast_copy_string(buf, p + 1, len);
 	else
 		ast_copy_string(buf, dest, len);
+
+	LOCAL_USER_REMOVE(u);
 
 	return 0;
 }

Modified: team/oej/jitterbuffer/image.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/image.c?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/image.c (original)
+++ team/oej/jitterbuffer/image.c Tue Mar 21 02:51:04 2006
@@ -97,12 +97,12 @@
 static void make_filename(char *buf, int len, char *filename, const char *preflang, char *ext)
 {
 	if (filename[0] == '/') {
-		if (preflang && strlen(preflang))
+		if (!ast_strlen_zero(preflang))
 			snprintf(buf, len, "%s-%s.%s", filename, preflang, ext);
 		else
 			snprintf(buf, len, "%s.%s", filename, ext);
 	} else {
-		if (preflang && strlen(preflang))
+		if (!ast_strlen_zero(preflang))
 			snprintf(buf, len, "%s/%s/%s-%s.%s", ast_config_AST_VAR_DIR, "images", filename, preflang, ext);
 		else
 			snprintf(buf, len, "%s/%s/%s.%s", ast_config_AST_VAR_DIR, "images", filename, ext);

Modified: team/oej/jitterbuffer/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/include/asterisk/channel.h?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/include/asterisk/channel.h (original)
+++ team/oej/jitterbuffer/include/asterisk/channel.h Tue Mar 21 02:51:04 2006
@@ -763,83 +763,79 @@
    will be -1 */
 struct ast_channel *ast_waitfor_nandfds(struct ast_channel **chan, int n, int *fds, int nfds, int *exception, int *outfd, int *ms);
 
-/*! Waits for input on a group of channels */
-/*! Wait for input on an array of channels for a given # of milliseconds. Return channel
-   with activity, or NULL if none has activity.  time "ms" is modified in-place, if applicable */
+/*! \brief Waits for input on a group of channels
+   Wait for input on an array of channels for a given # of milliseconds. 
+	\return Return channel with activity, or NULL if none has activity.  
+	\param ms time "ms" is modified in-place, if applicable */
 struct ast_channel *ast_waitfor_n(struct ast_channel **chan, int n, int *ms);
 
-/*! Waits for input on an fd */
-/*! This version works on fd's only.  Be careful with it. */
+/*! \brief Waits for input on an fd
+	This version works on fd's only.  Be careful with it. */
 int ast_waitfor_n_fd(int *fds, int n, int *ms, int *exception);
 
 
-/*! Reads a frame */
-/*!
+/*! \brief Reads a frame
  * \param chan channel to read a frame from
- * Read a frame.  Returns a frame, or NULL on error.  If it returns NULL, you
-   best just stop reading frames and assume the channel has been
-   disconnected. */
+	Read a frame.  
+	\return Returns a frame, or NULL on error.  If it returns NULL, you
+		best just stop reading frames and assume the channel has been
+		disconnected. */
 struct ast_frame *ast_read(struct ast_channel *chan);
 
-/*! Reads a frame, returning AST_FRAME_NULL frame if audio. */
-/*!
- * \param chan channel to read a frame from
- * Read a frame.  Returns a frame, or NULL on error.  If it returns NULL, you
-   best just stop reading frames and assume the channel has been
-   disconnected.  Audio is replaced with AST_FRAME_NULL to avoid 
-   transcode when the resulting audio is not necessary. */
+/*! \brief Reads a frame, returning AST_FRAME_NULL frame if audio. 
+ * Read a frame. 
+ 	\param chan channel to read a frame from
+	\return  Returns a frame, or NULL on error.  If it returns NULL, you
+		best just stop reading frames and assume the channel has been
+		disconnected.  
+	\note Audio is replaced with AST_FRAME_NULL to avoid 
+	transcode when the resulting audio is not necessary. */
 struct ast_frame *ast_read_noaudio(struct ast_channel *chan);
 
-/*! Write a frame to a channel */
-/*!
+/*! \brief Write a frame to a channel 
+ * This function writes the given frame to the indicated channel.
  * \param chan destination channel of the frame
  * \param frame frame that will be written
+ * \return It returns 0 on success, -1 on failure.
+ */
+int ast_write(struct ast_channel *chan, struct ast_frame *frame);
+
+/*! \brief Write video frame to a channel 
  * This function writes the given frame to the indicated channel.
- * It returns 0 on success, -1 on failure.
- */
-int ast_write(struct ast_channel *chan, struct ast_frame *frame);
-
-/*! Write video frame to a channel */
-/*!
  * \param chan destination channel of the frame
  * \param frame frame that will be written
- * This function writes the given frame to the indicated channel.
- * It returns 1 on success, 0 if not implemented, and -1 on failure.
+ * \return It returns 1 on success, 0 if not implemented, and -1 on failure.
  */
 int ast_write_video(struct ast_channel *chan, struct ast_frame *frame);
 
-/* Send empty audio to prime a channel driver */
+/*! \brief Send empty audio to prime a channel driver */
 int ast_prod(struct ast_channel *chan);
 
-/*! Sets read format on channel chan */
-/*! 
+/*! \brief Sets read format on channel chan
+ * Set read format for channel to whichever component of "format" is best. 
  * \param chan channel to change
  * \param format format to change to
- * Set read format for channel to whichever component of "format" is best. 
- * Returns 0 on success, -1 on failure
+ * \return Returns 0 on success, -1 on failure
  */
 int ast_set_read_format(struct ast_channel *chan, int format);
 
-/*! Sets write format on channel chan */
-/*! 
+/*! \brief Sets write format on channel chan
+ * Set write format for channel to whichever compoent of "format" is best. 
  * \param chan channel to change
  * \param format new format for writing
- * Set write format for channel to whichever compoent of "format" is best. 
- * Returns 0 on success, -1 on failure
+ * \return Returns 0 on success, -1 on failure
  */
 int ast_set_write_format(struct ast_channel *chan, int format);
 
-/*! Sends text to a channel */
-/*! 
+/*! \brief Sends text to a channel 
+ * Write text to a display on a channel
  * \param chan channel to act upon
  * \param text string of text to send on the channel
- * Write text to a display on a channel
- * Returns 0 on success, -1 on failure
+ * \return Returns 0 on success, -1 on failure
  */
 int ast_sendtext(struct ast_channel *chan, const char *text);
 
-/*! Receives a text character from a channel */
-/*! 
+/*! \brief Receives a text character from a channel
  * \param chan channel to act upon
  * \param timeout timeout in milliseconds (0 for infinite wait)
  * Read a char of text from a channel
@@ -847,58 +843,56 @@
  */
 int ast_recvchar(struct ast_channel *chan, int timeout);
 
-/*! Send a DTMF digit to a channel */
-/*! 
+/*! \brief Send a DTMF digit to a channel
+ * Send a DTMF digit to a channel.
  * \param chan channel to act upon
  * \param digit the DTMF digit to send, encoded in ASCII
- * Send a DTMF digit to a channel.
- * Returns 0 on success, -1 on failure
+ * \return Returns 0 on success, -1 on failure
  */
 int ast_senddigit(struct ast_channel *chan, char digit);
 
-/*! Receives a text string from a channel */
-/*! 
+/*! \brief Receives a text string from a channel
+ * Read a string of text from a channel
  * \param chan channel to act upon
  * \param timeout timeout in milliseconds (0 for infinite wait)
  * \return the received text, or NULL to signify failure.
- * Read a string of text from a channel
  */
 char *ast_recvtext(struct ast_channel *chan, int timeout);
 
-/*! Browse channels in use */
-/*! 
+/*! \brief Browse channels in use
+ * Browse the channels currently in use 
  * \param prev where you want to start in the channel list
- * Browse the channels currently in use 
- * Returns the next channel in the list, NULL on end.
- * If it returns a channel, that channel *has been locked*!
+ * \return Returns the next channel in the list, NULL on end.
+ * 	If it returns a channel, that channel *has been locked*!
  */
 struct ast_channel *ast_channel_walk_locked(const struct ast_channel *prev);
 
-/*! Get channel by name (locks channel) */
+/*! \brief Get channel by name (locks channel) */
 struct ast_channel *ast_get_channel_by_name_locked(const char *chan);
 
-/*! Get channel by name prefix (locks channel) */
+/*! \brief Get channel by name prefix (locks channel) */
 struct ast_channel *ast_get_channel_by_name_prefix_locked(const char *name, const int namelen);
 
-/*! Get channel by name prefix (locks channel) */
+/*! \brief Get channel by name prefix (locks channel) */
 struct ast_channel *ast_walk_channel_by_name_prefix_locked(struct ast_channel *chan, const char *name, const int namelen);
 
-/*--- ast_get_channel_by_exten_locked: Get channel by exten (and optionally context) and lock it */
+/*! \brief Get channel by exten (and optionally context) and lock it */
 struct ast_channel *ast_get_channel_by_exten_locked(const char *exten, const char *context);
 
-/*! Waits for a digit */
-/*! 
+/*! ! \brief Waits for a digit
  * \param c channel to wait for a digit on
  * \param ms how many milliseconds to wait
- * Wait for a digit.  Returns <0 on error, 0 on no entry, and the digit on success. */
+ * \return Returns <0 on error, 0 on no entry, and the digit on success. */
 int ast_waitfordigit(struct ast_channel *c, int ms);
 
-/* Same as above with audio fd for outputing read audio and ctrlfd to monitor for
-   reading. Returns 1 if ctrlfd becomes available */
+/*! \brief Wait for a digit
+ Same as ast_waitfordigit() with audio fd for outputing read audio and ctrlfd to monitor for reading. 
+ * \param c channel to wait for a digit on
+ * \param ms how many milliseconds to wait
+ * \return Returns 1 if ctrlfd becomes available */
 int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int ctrlfd);
 
-/*! Reads multiple digits */
-/*! 
+/*! Reads multiple digits 
  * \param c channel to read from
  * \param s string to read in to.  Must be at least the size of your length
  * \param len how many digits to read (maximum)
@@ -913,28 +907,26 @@
 int ast_readstring(struct ast_channel *c, char *s, int len, int timeout, int rtimeout, char *enders);
 int ast_readstring_full(struct ast_channel *c, char *s, int len, int timeout, int rtimeout, char *enders, int audiofd, int ctrlfd);
 
-/*! Report DTMF on channel 0 */
+/*! \brief Report DTMF on channel 0 */
 #define AST_BRIDGE_DTMF_CHANNEL_0		(1 << 0)		
-/*! Report DTMF on channel 1 */
+/*! \brief Report DTMF on channel 1 */
 #define AST_BRIDGE_DTMF_CHANNEL_1		(1 << 1)		
-/*! Return all voice frames on channel 0 */
+/*! \brief Return all voice frames on channel 0 */
 #define AST_BRIDGE_REC_CHANNEL_0		(1 << 2)		
-/*! Return all voice frames on channel 1 */
+/*! \brief Return all voice frames on channel 1 */
 #define AST_BRIDGE_REC_CHANNEL_1		(1 << 3)		
-/*! Ignore all signal frames except NULL */
+/*! \brief Ignore all signal frames except NULL */
 #define AST_BRIDGE_IGNORE_SIGS			(1 << 4)		
 
 
-/*! Makes two channel formats compatible */
-/*! 
+/*! \brief Makes two channel formats compatible 
  * \param c0 first channel to make compatible
  * \param c1 other channel to make compatible
- * Set two channels to compatible formats -- call before ast_channel_bridge in general .  Returns 0 on success
-   and -1 if it could not be done */
+ * Set two channels to compatible formats -- call before ast_channel_bridge in general .  
+ * \return Returns 0 on success and -1 if it could not be done */
 int ast_channel_make_compatible(struct ast_channel *c0, struct ast_channel *c1);
 
-/*! Bridge two channels together */
-/*! 
+/*! Bridge two channels together 
  * \param c0 first channel to bridge
  * \param c1 second channel to bridge
  * \param config config for the channels
@@ -945,8 +937,7 @@
 /* int ast_channel_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc); */
 int ast_channel_bridge(struct ast_channel *c0,struct ast_channel *c1,struct ast_bridge_config *config, struct ast_frame **fo, struct ast_channel **rc);
 
-/*! Weird function made for call transfers */
-/*! 
+/*! \brief Weird function made for call transfers
  * \param original channel to make a copy of
  * \param clone copy of the original channel
  * This is a very strange and freaky function used primarily for transfer.  Suppose that

Modified: team/oej/jitterbuffer/include/solaris-compat/compat.h
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/include/solaris-compat/compat.h?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/include/solaris-compat/compat.h (original)
+++ team/oej/jitterbuffer/include/solaris-compat/compat.h Tue Mar 21 02:51:04 2006
@@ -42,5 +42,5 @@
 
 char* strsep(char** str, const char* delims);
 int setenv(const char *name, const char *value, int overwrite);
-int unsetenv(const char *name);
+void unsetenv(const char *name);
 #endif

Modified: team/oej/jitterbuffer/pbx.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/pbx.c?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/pbx.c (original)
+++ team/oej/jitterbuffer/pbx.c Tue Mar 21 02:51:04 2006
@@ -3728,10 +3728,14 @@
 	}
 	/* Fill the mask. Remember that ranges are cyclic */
 	mask = 1 << e;	/* initialize with last element */
-	for ( ; s != e; s++) {
-		if (s == max)
-			s = 0 ;
-		mask |= (1 << s);
+	while (s != e) {
+		if (s >= max) {
+			s = 0;
+			mask |= (1 << s);
+		} else {
+			mask |= (1 << s);
+			s++;
+		}
 	}
 	return mask;
 }

Modified: team/oej/jitterbuffer/strcompat.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer/strcompat.c?rev=13785&r1=13784&r2=13785&view=diff
==============================================================================
--- team/oej/jitterbuffer/strcompat.c (original)
+++ team/oej/jitterbuffer/strcompat.c Tue Mar 21 02:51:04 2006
@@ -33,25 +33,22 @@
 int setenv(const char *name, const char *value, int overwrite)
 {
 	unsigned char *buf;
-	int buflen, ret;
+	int buflen;
 
 	buflen = strlen(name) + strlen(value) + 2;
-	if ((buf = malloc(buflen)) == NULL)
+	if (!(buf = alloca(buflen)))
  		return -1;
 
 	if (!overwrite && getenv(name))
 		return 0;
 
 	snprintf(buf, buflen, "%s=%s", name, value);
-	ret = putenv(buf);
 
-	free(buf);
-
-	return ret;
+	return putenv(buf);
 }
 
-int unsetenv(const char *name)
+void unsetenv(const char *name)
 {
-  setenv(name,"",0);
+	setenv(name, "", 0);
 }
 



More information about the asterisk-commits mailing list