[asterisk-commits] branch oej/sipregister r17413 - in /team/oej/sipregister: ./ apps/ channels/ ...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Apr 4 12:43:13 MST 2006


Author: oej
Date: Tue Apr  4 14:41:44 2006
New Revision: 17413

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

Added:
    team/oej/sipregister/doc/ajam.txt
      - copied unchanged from r17404, trunk/doc/ajam.txt
    team/oej/sipregister/static-http/
      - copied from r17404, trunk/static-http/
    team/oej/sipregister/static-http/ajamdemo.html
      - copied unchanged from r17404, trunk/static-http/ajamdemo.html
    team/oej/sipregister/static-http/astman.css
      - copied unchanged from r17404, trunk/static-http/astman.css
    team/oej/sipregister/static-http/astman.js
      - copied unchanged from r17404, trunk/static-http/astman.js
    team/oej/sipregister/static-http/prototype.js
      - copied unchanged from r17404, trunk/static-http/prototype.js
Removed:
    team/oej/sipregister/formats/format_au.c
    team/oej/sipregister/formats/format_pcm_alaw.c
Modified:
    team/oej/sipregister/   (props changed)
    team/oej/sipregister/.cleancount
    team/oej/sipregister/CREDITS
    team/oej/sipregister/Makefile
    team/oej/sipregister/README
    team/oej/sipregister/apps/app_alarmreceiver.c
    team/oej/sipregister/apps/app_dial.c
    team/oej/sipregister/apps/app_echo.c
    team/oej/sipregister/apps/app_exec.c
    team/oej/sipregister/apps/app_macro.c
    team/oej/sipregister/apps/app_meetme.c
    team/oej/sipregister/apps/app_milliwatt.c
    team/oej/sipregister/apps/app_page.c
    team/oej/sipregister/apps/app_queue.c
    team/oej/sipregister/apps/app_rpt.c
    team/oej/sipregister/apps/app_senddtmf.c
    team/oej/sipregister/apps/app_sms.c
    team/oej/sipregister/apps/app_stack.c
    team/oej/sipregister/apps/app_voicemail.c
    team/oej/sipregister/apps/app_while.c
    team/oej/sipregister/asterisk.8
    team/oej/sipregister/asterisk.c
    team/oej/sipregister/asterisk.sgml
    team/oej/sipregister/callerid.c
    team/oej/sipregister/channel.c
    team/oej/sipregister/channels/chan_h323.c
    team/oej/sipregister/channels/chan_iax2.c
    team/oej/sipregister/channels/chan_local.c
    team/oej/sipregister/channels/chan_misdn.c
    team/oej/sipregister/channels/chan_oss.c
    team/oej/sipregister/channels/chan_sip.c
    team/oej/sipregister/channels/chan_zap.c
    team/oej/sipregister/channels/h323/ast_h323.cpp
    team/oej/sipregister/channels/iax2-provision.c
    team/oej/sipregister/channels/iax2-provision.h
    team/oej/sipregister/channels/misdn/Makefile
    team/oej/sipregister/channels/misdn/isdn_lib.c
    team/oej/sipregister/channels/misdn/isdn_lib.h
    team/oej/sipregister/channels/misdn/isdn_msg_parser.c
    team/oej/sipregister/cli.c
    team/oej/sipregister/codecs/codec_a_mu.c
    team/oej/sipregister/codecs/codec_adpcm.c
    team/oej/sipregister/codecs/codec_alaw.c
    team/oej/sipregister/codecs/codec_g723_1.c
    team/oej/sipregister/codecs/codec_g726.c
    team/oej/sipregister/codecs/codec_gsm.c
    team/oej/sipregister/codecs/codec_ilbc.c
    team/oej/sipregister/codecs/codec_lpc10.c
    team/oej/sipregister/codecs/codec_speex.c
    team/oej/sipregister/codecs/codec_ulaw.c
    team/oej/sipregister/codecs/gsm/Makefile
    team/oej/sipregister/configs/extensions.conf.sample
    team/oej/sipregister/configs/features.conf.sample
    team/oej/sipregister/configs/http.conf.sample
    team/oej/sipregister/configs/manager.conf.sample
    team/oej/sipregister/configs/oss.conf.sample
    team/oej/sipregister/configs/queues.conf.sample
    team/oej/sipregister/configs/sip.conf.sample
    team/oej/sipregister/configs/skinny.conf.sample
    team/oej/sipregister/contrib/init.d/rc.redhat.asterisk
    team/oej/sipregister/devicestate.c
    team/oej/sipregister/doc/00README.1st
    team/oej/sipregister/doc/CODING-GUIDELINES
    team/oej/sipregister/doc/asterisk-conf.txt
    team/oej/sipregister/doc/manager.txt
    team/oej/sipregister/file.c
    team/oej/sipregister/formats/Makefile
    team/oej/sipregister/formats/format_g723.c
    team/oej/sipregister/formats/format_g726.c
    team/oej/sipregister/formats/format_g729.c
    team/oej/sipregister/formats/format_gsm.c
    team/oej/sipregister/formats/format_h263.c
    team/oej/sipregister/formats/format_h264.c
    team/oej/sipregister/formats/format_ilbc.c
    team/oej/sipregister/formats/format_ogg_vorbis.c
    team/oej/sipregister/formats/format_pcm.c
    team/oej/sipregister/formats/format_sln.c
    team/oej/sipregister/formats/format_vox.c
    team/oej/sipregister/formats/format_wav.c
    team/oej/sipregister/formats/format_wav_gsm.c
    team/oej/sipregister/http.c
    team/oej/sipregister/include/asterisk.h
    team/oej/sipregister/include/asterisk/adsi.h
    team/oej/sipregister/include/asterisk/app.h
    team/oej/sipregister/include/asterisk/callerid.h
    team/oej/sipregister/include/asterisk/channel.h
    team/oej/sipregister/include/asterisk/cli.h
    team/oej/sipregister/include/asterisk/crypto.h
    team/oej/sipregister/include/asterisk/dns.h
    team/oej/sipregister/include/asterisk/doxyref.h
    team/oej/sipregister/include/asterisk/enum.h
    team/oej/sipregister/include/asterisk/features.h
    team/oej/sipregister/include/asterisk/file.h
    team/oej/sipregister/include/asterisk/frame.h
    team/oej/sipregister/include/asterisk/fskmodem.h
    team/oej/sipregister/include/asterisk/http.h
    team/oej/sipregister/include/asterisk/image.h
    team/oej/sipregister/include/asterisk/indications.h
    team/oej/sipregister/include/asterisk/io.h
    team/oej/sipregister/include/asterisk/linkedlists.h
    team/oej/sipregister/include/asterisk/localtime.h
    team/oej/sipregister/include/asterisk/lock.h
    team/oej/sipregister/include/asterisk/logger.h
    team/oej/sipregister/include/asterisk/manager.h
    team/oej/sipregister/include/asterisk/module.h
    team/oej/sipregister/include/asterisk/musiconhold.h
    team/oej/sipregister/include/asterisk/options.h
    team/oej/sipregister/include/asterisk/pbx.h
    team/oej/sipregister/include/asterisk/plc.h
    team/oej/sipregister/include/asterisk/rtp.h
    team/oej/sipregister/include/asterisk/sched.h
    team/oej/sipregister/include/asterisk/tdd.h
    team/oej/sipregister/include/asterisk/term.h
    team/oej/sipregister/include/solaris-compat/compat.h
    team/oej/sipregister/indications.c
    team/oej/sipregister/loader.c
    team/oej/sipregister/manager.c
    team/oej/sipregister/pbx.c
    team/oej/sipregister/pbx/pbx_ael.c
    team/oej/sipregister/pbx/pbx_config.c
    team/oej/sipregister/pbx/pbx_dundi.c
    team/oej/sipregister/pbx/pbx_loopback.c
    team/oej/sipregister/pbx/pbx_realtime.c
    team/oej/sipregister/plc.c
    team/oej/sipregister/res/res_agi.c
    team/oej/sipregister/res/res_clioriginate.c
    team/oej/sipregister/res/res_features.c
    team/oej/sipregister/res/res_indications.c
    team/oej/sipregister/res/res_musiconhold.c
    team/oej/sipregister/res/res_smdi.c
    team/oej/sipregister/res/snmp/agent.c
    team/oej/sipregister/rtp.c
    team/oej/sipregister/strcompat.c
    team/oej/sipregister/translate.c
    team/oej/sipregister/utils.c
    team/oej/sipregister/utils/astman.c

Propchange: team/oej/sipregister/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

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

Propchange: team/oej/sipregister/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Apr  4 14:41:44 2006
@@ -1,1 +1,1 @@
-/trunk:1-15614
+/trunk:1-17410

Modified: team/oej/sipregister/.cleancount
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/.cleancount?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/.cleancount (original)
+++ team/oej/sipregister/.cleancount Tue Apr  4 14:41:44 2006
@@ -1,1 +1,1 @@
-11
+13

Modified: team/oej/sipregister/CREDITS
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/CREDITS?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/CREDITS (original)
+++ team/oej/sipregister/CREDITS Tue Apr  4 14:41:44 2006
@@ -90,6 +90,11 @@
 Music provided by www.freeplaymusic.com
 
 === OTHER SOURCE CODE IN ASTERISK ===
+Asterisk uses libedit, the lightweight readline replacement from
+NetBSD. It is BSD-licensed and requires the following statement:
+
+      This product includes software developed by the NetBSD
+      Foundation, Inc. and its contributors.
 
 Digium did not implement the codecs in Asterisk.  Here is the copyright on the
 GSM source:

Modified: team/oej/sipregister/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/Makefile?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/Makefile (original)
+++ team/oej/sipregister/Makefile Tue Apr  4 14:41:44 2006
@@ -566,6 +566,13 @@
 
 datafiles: all
 	if [ x`$(ID) -un` = xroot ]; then sh build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
+	# Should static HTTP be installed during make samples or even with its own target ala
+	# webvoicemail?  There are portions here that *could* be customized but might also be
+	# improved a lot.  I'll put it here for now.
+	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/static-http
+	for x in static-http/*; do \
+		install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/static-http ; \
+	done
 	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
 	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
 	for x in sounds/digits/*.gsm; do \
@@ -788,6 +795,8 @@
 		echo ";astctlowner = root" ; \
 		echo ";astctlgroup = apache" ; \
 		echo ";astctl = asterisk.ctl" ; \
+		echo ";[options]" ; \
+		echo ";internal_timing = yes" ; \
 		) > $(DESTDIR)$(ASTCONFPATH) ; \
 	else \
 		echo "Skipping asterisk.conf creation"; \

Modified: team/oej/sipregister/README
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/README?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/README (original)
+++ team/oej/sipregister/README Tue Apr  4 14:41:44 2006
@@ -2,14 +2,14 @@
 by Mark Spencer <markster at digium.com>
 and the Asterisk.org developer community
 
-Copyright (C) 2001-2005 Digium, Inc.
+Copyright (C) 2001-2006 Digium, Inc.
 and other copyright holders.
 ================================================================
 
 * SECURITY
   It is imperative that you read and fully understand the contents of
-the SECURITY file before you attempt to configure and run an Asterisk
-server.
+the security information file (doc/security.txt) before you attempt 
+to configure and run an Asterisk server.
 
 * WHAT IS ASTERISK ?
   Asterisk is an Open Source PBX and telephony toolkit.  It is, in a
@@ -84,11 +84,18 @@
 
   So let's proceed:
 
-1) Run "make"
+1) Read the README files.
+   There are more README files than this one in the doc/ directory.
+   Start with doc/00README.1st
+   You may also want to check the configuration files that contain
+   examples and reference guides. They are all in the configs/
+   directory.
+
+2) Run "make"
 
   Assuming the build completes successfully:
 
-2) Run "make install"
+3) Run "make install"
 
   Each time you update or checkout from the repository, you are strongly
 encouraged to ensure all previous object files are removed to avoid internal 
@@ -99,7 +106,7 @@
   If this is your first time working with Asterisk, you may wish to install
 the sample PBX, with demonstration extensions, etc.  If so, run:
 
-3) "make samples"
+4) "make samples"
 
   Doing so will overwrite any existing config files you have.
 

Modified: team/oej/sipregister/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_alarmreceiver.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_alarmreceiver.c (original)
+++ team/oej/sipregister/apps/app_alarmreceiver.c Tue Apr  4 14:41:44 2006
@@ -551,13 +551,12 @@
 
 		checksum = checksum % 15;
 
-		if(checksum){
+		if (checksum) {
 			database_increment("checksum-errors");
-			if(option_verbose >= 2){
+			if (option_verbose >= 2)
 				ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Nonzero checksum\n");
 			ast_log(LOG_DEBUG, "AlarmReceiver: Nonzero checksum\n");
 			continue;
-			}
 		}
 
 		/* Check the message type for correctness */

Modified: team/oej/sipregister/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_dial.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_dial.c (original)
+++ team/oej/sipregister/apps/app_dial.c Tue Apr  4 14:41:44 2006
@@ -1449,7 +1449,7 @@
 					if (*ch == '^')
 						*ch = '|';
 				}
-				res = pbx_exec(peer, app, opt_args[OPT_ARG_CALLEE_MACRO], 1);
+				res = pbx_exec(peer, app, opt_args[OPT_ARG_CALLEE_MACRO]);
 				ast_log(LOG_DEBUG, "Macro exited with status %d\n", res);
 				res = 0;
 			} else {

Modified: team/oej/sipregister/apps/app_echo.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_echo.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_echo.c (original)
+++ team/oej/sipregister/apps/app_echo.c Tue Apr  4 14:41:44 2006
@@ -59,7 +59,6 @@
 	int res = -1;
 	int format;
 	struct localuser *u;
-	struct ast_frame *f;
 
 	LOCAL_USER_ADD(u);
 
@@ -68,7 +67,7 @@
 	ast_set_read_format(chan, format);
 
 	while (ast_waitfor(chan, -1) > -1) {
-		f = ast_read(chan);
+		struct ast_frame *f = ast_read(chan);
 		if (!f)
 			break;
 		f->delivery.tv_sec = 0;

Modified: team/oej/sipregister/apps/app_exec.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_exec.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_exec.c (original)
+++ team/oej/sipregister/apps/app_exec.c Tue Apr  4 14:41:44 2006
@@ -82,7 +82,7 @@
 			if (appname) {
 				app = pbx_findapp(appname);
 				if (app) {
-					res = pbx_exec(chan, app, args, 1);
+					res = pbx_exec(chan, app, args);
 				} else {
 					ast_log(LOG_WARNING, "Could not find application (%s)\n", appname);
 					res = -1;

Modified: team/oej/sipregister/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_macro.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_macro.c (original)
+++ team/oej/sipregister/apps/app_macro.c Tue Apr  4 14:41:44 2006
@@ -188,7 +188,7 @@
   		snprintf(varname, sizeof(varname), "ARG%d", argc);
 		s = pbx_builtin_getvar_helper(chan, varname);
 		if (s)
-			oldargs[argc] = strdup(s);
+			oldargs[argc] = ast_strdup(s);
 		pbx_builtin_setvar_helper(chan, varname, cur);
 		argc++;
 	}

Modified: team/oej/sipregister/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_meetme.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_meetme.c (original)
+++ team/oej/sipregister/apps/app_meetme.c Tue Apr  4 14:41:44 2006
@@ -685,42 +685,36 @@
 	return 0;
 }
 
-static char *complete_confcmd(const char *line, const char *word, int pos, int state) {
-#define CONF_COMMANDS 6
-	int which = 0, x = 0;
+static char *complete_confcmd(const char *line, const char *word, int pos, int state)
+{
+	static char *cmds[] = {"lock", "unlock", "mute", "unmute", "kick", "list", NULL};
+
+	int len = strlen(word);
+	int which = 0;
 	struct ast_conference *cnf = NULL;
 	struct ast_conf_user *usr = NULL;
 	char *confno = NULL;
 	char usrno[50] = "";
-	char cmds[CONF_COMMANDS][20] = {"lock", "unlock", "mute", "unmute", "kick", "list"};
-	char *myline;
+	char *myline, *ret = NULL;
 	
-	if (pos == 1) {
-		/* Command */
-		for (x = 0;x < CONF_COMMANDS; x++) {
-			if (!strncasecmp(cmds[x], word, strlen(word))) {
-				if (++which > state) {
-					return strdup(cmds[x]);
-				}
-			}
-		}
-	} else if (pos == 2) {
-		/* Conference Number */
+	if (pos == 1) {		/* Command */
+		return ast_cli_complete(word, cmds, state);
+	} else if (pos == 2) {	/* Conference Number */
 		AST_LIST_LOCK(&confs);
 		AST_LIST_TRAVERSE(&confs, cnf, list) {
-			if (!strncasecmp(word, cnf->confno, strlen(word))) {
-				if (++which > state)
-					break;
-			}
-		}
+			if (!strncasecmp(word, cnf->confno, len) && ++which > state) {
+				ret = cnf->confno;
+				break;
+			}
+		}
+		ret = ast_strdup(ret); /* dup before releasing the lock */
 		AST_LIST_UNLOCK(&confs);
-		return cnf ? strdup(cnf->confno) : NULL;
+		return ret;
 	} else if (pos == 3) {
 		/* User Number || Conf Command option*/
 		if (strstr(line, "mute") || strstr(line, "kick")) {
-			if ((state == 0) && (strstr(line, "kick") || strstr(line,"mute")) && !(strncasecmp(word, "all", strlen(word)))) {
+			if (state == 0 && (strstr(line, "kick") || strstr(line,"mute")) && !strncasecmp(word, "all", len))
 				return strdup("all");
-			}
 			which++;
 			AST_LIST_LOCK(&confs);
 
@@ -740,10 +734,8 @@
 				/* Search for the user */
 				for (usr = cnf->firstuser; usr; usr = usr->nextuser) {
 					snprintf(usrno, sizeof(usrno), "%d", usr->user_no);
-					if (!strncasecmp(word, usrno, strlen(word))) {
-						if (++which > state)
-							break;
-					}
+					if (!strncasecmp(word, usrno, len) && ++which > state)
+						break;
 				}
 			}
 			AST_LIST_UNLOCK(&confs);
@@ -1151,7 +1143,7 @@
 		app = pbx_findapp("agi");
 		if (app) {
 			char *s = ast_strdupa(agifile);
-			ret = pbx_exec(chan, app, s, 1);
+			ret = pbx_exec(chan, app, s);
 		} else {
 			ast_log(LOG_WARNING, "Could not find application (agi)\n");
 			ret = -2;

Modified: team/oej/sipregister/apps/app_milliwatt.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_milliwatt.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_milliwatt.c (original)
+++ team/oej/sipregister/apps/app_milliwatt.c Tue Apr  4 14:41:44 2006
@@ -71,20 +71,27 @@
 {
 	struct ast_frame wf;
 	unsigned char buf[AST_FRIENDLY_OFFSET + 640];
-	int i,*indexp = (int *) data;
+	const int maxsamples = sizeof (buf) / sizeof (buf[0]);
+	int i, *indexp = (int *) data;
 
-	if (len + AST_FRIENDLY_OFFSET > sizeof(buf))
-	{
-		ast_log(LOG_WARNING,"Only doing %d bytes (%d bytes requested)\n",(int)(sizeof(buf) - AST_FRIENDLY_OFFSET),len);
-		len = sizeof(buf) - AST_FRIENDLY_OFFSET;
+	/* Instead of len, use samples, because channel.c generator_force
+	* generate(chan, tmp, 0, 160) ignores len. In any case, len is
+	* a multiple of samples, given by number of samples times bytes per
+	* sample. In the case of ulaw, len = samples. for signed linear
+	* len = 2 * samples */
+
+	if (samples > maxsamples) {
+		ast_log(LOG_WARNING, "Only doing %d samples (%d requested)\n", maxsamples, samples);
+		samples = maxsamples;
 	}
+	len = samples * sizeof (buf[0]);
 	wf.frametype = AST_FRAME_VOICE;
 	wf.subclass = AST_FORMAT_ULAW;
 	wf.offset = AST_FRIENDLY_OFFSET;
 	wf.mallocd = 0;
 	wf.data = buf + AST_FRIENDLY_OFFSET;
 	wf.datalen = len;
-	wf.samples = wf.datalen;
+	wf.samples = samples;
 	wf.src = "app_milliwatt";
 	wf.delivery.tv_sec = 0;
 	wf.delivery.tv_usec = 0;

Modified: team/oej/sipregister/apps/app_page.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_page.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_page.c (original)
+++ team/oej/sipregister/apps/app_page.c Tue Apr  4 14:41:44 2006
@@ -186,7 +186,7 @@
 	}
 	if (!res) {
 		snprintf(meetmeopts, sizeof(meetmeopts), "%ud|A%sqxd", confid, ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "t");
-		pbx_exec(chan, app, meetmeopts, 1);
+		pbx_exec(chan, app, meetmeopts);
 	}
 
 	LOCAL_USER_REMOVE(u);

Modified: team/oej/sipregister/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_queue.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_queue.c (original)
+++ team/oej/sipregister/apps/app_queue.c Tue Apr  4 14:41:44 2006
@@ -1211,7 +1211,7 @@
 
 	ast_mutex_lock(&qe->parent->lock);
 	if (newvalue <= qe->parent->servicelevel)
-       		qe->parent->callscompletedinsl++;
+		qe->parent->callscompletedinsl++;
 	oldvalue = qe->parent->holdtime;
 	qe->parent->holdtime = (((oldvalue << 2) - oldvalue) + newvalue) >> 2;
 	ast_mutex_unlock(&qe->parent->lock);
@@ -1440,12 +1440,9 @@
 	if (tmp->chan->cid.cid_ani)
 		free(tmp->chan->cid.cid_ani);
 	tmp->chan->cid.cid_ani = NULL;
-	if (qe->chan->cid.cid_num)
-		tmp->chan->cid.cid_num = strdup(qe->chan->cid.cid_num);
-	if (qe->chan->cid.cid_name)
-		tmp->chan->cid.cid_name = strdup(qe->chan->cid.cid_name);
-	if (qe->chan->cid.cid_ani)
-		tmp->chan->cid.cid_ani = strdup(qe->chan->cid.cid_ani);
+	tmp->chan->cid.cid_num = ast_strdup(qe->chan->cid.cid_num);
+	tmp->chan->cid.cid_name = ast_strdup(qe->chan->cid.cid_name);
+	tmp->chan->cid.cid_ani = ast_strdup(qe->chan->cid.cid_ani);
 
 	/* Inherit specially named variables from parent channel */
 	ast_channel_inherit_variables(qe->chan, tmp->chan);
@@ -1724,21 +1721,12 @@
 					} else {
 						if (o->chan->cid.cid_num)
 							free(o->chan->cid.cid_num);
-						o->chan->cid.cid_num = NULL;
+						o->chan->cid.cid_num = ast_strdup(in->cid.cid_num);
+
 						if (o->chan->cid.cid_name)
 							free(o->chan->cid.cid_name);
-						o->chan->cid.cid_name = NULL;
-
-						if (in->cid.cid_num) {
-							o->chan->cid.cid_num = strdup(in->cid.cid_num);
-							if (!o->chan->cid.cid_num)
-								ast_log(LOG_WARNING, "Out of memory\n");	
-						}
-						if (in->cid.cid_name) {
-							o->chan->cid.cid_name = strdup(in->cid.cid_name);
-							if (!o->chan->cid.cid_name)
-								ast_log(LOG_WARNING, "Out of memory\n");	
-						}
+						o->chan->cid.cid_name = ast_strdup(in->cid.cid_name);
+
 						ast_string_field_set(o->chan, accountcode, in->accountcode);
 						o->chan->cdrflags = in->cdrflags;
 
@@ -1749,10 +1737,8 @@
 						}
 						if (o->chan->cid.cid_rdnis) 
 							free(o->chan->cid.cid_rdnis);
-						if (!ast_strlen_zero(in->macroexten))
-							o->chan->cid.cid_rdnis = strdup(in->macroexten);
-						else
-							o->chan->cid.cid_rdnis = strdup(in->exten);
+						o->chan->cid.cid_rdnis =
+								ast_strdup(S_OR(in->macroexten, in->exten));
 						if (ast_call(o->chan, tmpchan, 0)) {
 							ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan);
 							do_hang(o);
@@ -1767,7 +1753,7 @@
 				if (f) {
 					if (f->frametype == AST_FRAME_CONTROL) {
 						switch(f->subclass) {
-		    			case AST_CONTROL_ANSWER:
+						case AST_CONTROL_ANSWER:
 							/* This is our guy if someone answered. */
 							if (!peer) {
 								if (option_verbose > 2)
@@ -2097,8 +2083,8 @@
 	if (!ast_strlen_zero(announceoverride))
 		announce = announceoverride;
 
- 	for (;cur; cur = cur->next) {
- 		struct callattempt *tmp = ast_calloc(1, sizeof(*tmp));
+	for (;cur; cur = cur->next) {
+		struct callattempt *tmp = ast_calloc(1, sizeof(*tmp));
 		if (!tmp) {
 			ast_mutex_unlock(&qe->parent->lock);
 			if (use_weight) 
@@ -2207,7 +2193,7 @@
 				/* Agent must have hung up */
 				ast_log(LOG_WARNING, "Agent on %s hungup on the customer.  They're going to be pissed.\n", peer->name);
 				ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "AGENTDUMP", "%s", "");
-                                record_abandoned(qe);
+				record_abandoned(qe);
 				if (qe->parent->eventwhencalled) {
 					manager_event(EVENT_FLAG_AGENT, "AgentDump",
 						      "Queue: %s\r\n"
@@ -2237,7 +2223,7 @@
 		if (res < 0) {
 			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "SYSCOMPAT", "%s", "");
 			ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", qe->chan->name, peer->name);
-                        record_abandoned(qe);
+		record_abandoned(qe);
 			ast_hangup(peer);
 			return -1;
 		}
@@ -2417,7 +2403,7 @@
 				free(last_member);
 
 				if (queue_persistent_members)
-				    dump_queue_members(q);
+					dump_queue_members(q);
 
 				res = RES_OKAY;
 			} else {
@@ -2454,17 +2440,17 @@
 				new_member->next = q->members;
 				q->members = new_member;
 				manager_event(EVENT_FLAG_AGENT, "QueueMemberAdded",
-					"Queue: %s\r\n"
-					"Location: %s\r\n"
-					"Membership: %s\r\n"
-					"Penalty: %d\r\n"
-					"CallsTaken: %d\r\n"
-					"LastCall: %d\r\n"
-					"Status: %d\r\n"
-					"Paused: %d\r\n",
-				q->name, new_member->interface, new_member->dynamic ? "dynamic" : "static",
-				new_member->penalty, new_member->calls, (int)new_member->lastcall, new_member->status, new_member->paused);
-					
+						"Queue: %s\r\n"
+						"Location: %s\r\n"
+						"Membership: %s\r\n"
+						"Penalty: %d\r\n"
+						"CallsTaken: %d\r\n"
+						"LastCall: %d\r\n"
+						"Status: %d\r\n"
+						"Paused: %d\r\n",
+						q->name, new_member->interface, new_member->dynamic ? "dynamic" : "static",
+						new_member->penalty, new_member->calls, (int)new_member->lastcall, new_member->status, new_member->paused);
+
 				if (dump)
 					dump_queue_members(q);
 
@@ -2503,7 +2489,7 @@
 				mem->paused = paused;
 
 				if (queue_persistent_members)
-				    dump_queue_members(q);
+					dump_queue_members(q);
 
 				ast_queue_log(q->name, "NONE", interface, (paused ? "PAUSE" : "UNPAUSE"), "%s", "");
 
@@ -2682,7 +2668,7 @@
 	}
 
 	if (!(parse = ast_strdupa(data))) 
-		return -1;	
+		return -1;
 
 	AST_STANDARD_APP_ARGS(args, parse);
 
@@ -2958,7 +2944,7 @@
 check_turns:
 		if (ringing) {
 			ast_indicate(chan, AST_CONTROL_RINGING);
-		} else {              
+		} else {
 			ast_moh_start(chan, qe.moh);
 		}
 		for (;;) {
@@ -2972,8 +2958,8 @@
 				 ast_queue_log(args.queuename, chan->uniqueid, "NONE", "ABANDON", "%d|%d|%ld", qe.pos, qe.opos, (long)time(NULL) - qe.start);
 				if (option_verbose > 2) {
 					ast_verbose(VERBOSE_PREFIX_3 "User disconnected from queue %s while waiting their turn\n", args.queuename);
-					res = -1;
 				}
+				res = -1;
 				break;
 			}
 			if (!res) 
@@ -2995,7 +2981,7 @@
 
 				/* Leave if we have exceeded our queuetimeout */
 				if (qe.expire && (time(NULL) > qe.expire)) {
-                                        record_abandoned(&qe);
+					record_abandoned(&qe);
 					reason = QUEUE_TIMEOUT;
 					res = 0;
 					ast_queue_log(args.queuename, chan->uniqueid,"NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
@@ -3071,8 +3057,8 @@
 					ast_queue_log(args.queuename, chan->uniqueid, "NONE", "ABANDON", "%d|%d|%ld", qe.pos, qe.opos, (long)time(NULL) - qe.start);
 					if (option_verbose > 2) {
 						ast_verbose(VERBOSE_PREFIX_3 "User disconnected from queue %s when they almost made it\n", args.queuename);
-						res = -1;
 					}
+					res = -1;
 					break;
 				}
 				if (res && valid_exit(&qe, res)) {
@@ -3081,12 +3067,10 @@
 				}
 				/* exit after 'timeout' cycle if 'n' option enabled */
 				if (go_on) {
-					if (option_verbose > 2) {
+					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "Exiting on time-out cycle\n");
-						res = -1;
-					}
 					ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
-                                        record_abandoned(&qe);
+					record_abandoned(&qe);
 					reason = QUEUE_TIMEOUT;
 					res = 0;
 					break;
@@ -3501,8 +3485,8 @@
 	
 	AST_LIST_LOCK(&queues);
 	AST_LIST_TRAVERSE(&queues, q, list) {
-		if (!strncasecmp(word, q->name, wordlen) &&  (++which > state)) {
-			ret = strdup(q->name);	
+		if (!strncasecmp(word, q->name, wordlen) && ++which > state) {
+			ret = ast_strdup(q->name);	
 			break;
 		}
 	}
@@ -3766,11 +3750,11 @@
 	case 3:	/* Don't attempt to complete name of member (infinite possibilities) */
 		return NULL;
 	case 4:	/* only one possible match, "to" */
-		return state == 0 ? strdup("to") : NULL;
+		return state == 0 ? ast_strdup("to") : NULL;
 	case 5:	/* <queue> */
 		return complete_queue(line, word, pos, state);
 	case 6: /* only one possible match, "penalty" */
-		return state == 0 ? strdup("penalty") : NULL;
+		return state == 0 ? ast_strdup("penalty") : NULL;
 	case 7:
 		if (state < 100) {	/* 0-99 */
 			char *num;
@@ -3823,23 +3807,23 @@
 	struct ast_call_queue *q;
 	struct member *m;
 
- 	/* 0 - add; 1 - queue; 2 - member; 3 - <member>; 4 - from; 5 - <queue> */
- 	if (pos > 5 || pos < 3)
-  		return NULL;
- 	if (pos == 4)	/* only one possible match, 'from' */
- 		return state == 0 ? strdup("from") : NULL;
-  
- 	if (pos == 5)	/* No need to duplicate code */
-  		return complete_queue(line, word, pos, state);
-  
- 	/* here is the case for 3, <member> */
-	if (!AST_LIST_EMPTY(&queues)) {
+	/* 0 - add; 1 - queue; 2 - member; 3 - <member>; 4 - from; 5 - <queue> */
+	if (pos > 5 || pos < 3)
+		return NULL;
+	if (pos == 4)	/* only one possible match, 'from' */
+		return state == 0 ? ast_strdup("from") : NULL;
+
+	if (pos == 5)	/* No need to duplicate code */
+		return complete_queue(line, word, pos, state);
+
+	/* here is the case for 3, <member> */
+	if (!AST_LIST_EMPTY(&queues)) { /* XXX unnecessary ? the traverse does that for us */
 		AST_LIST_TRAVERSE(&queues, q, list) {
 			ast_mutex_lock(&q->lock);
 			for (m = q->members ; m ; m = m->next) {
 				if (++which > state) {
 					ast_mutex_unlock(&q->lock);
-					return strdup(m->interface);
+					return ast_strdup(m->interface);
 				}
 			}
 			ast_mutex_unlock(&q->lock);

Modified: team/oej/sipregister/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_rpt.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_rpt.c (original)
+++ team/oej/sipregister/apps/app_rpt.c Tue Apr  4 14:41:44 2006
@@ -608,7 +608,6 @@
 /* Debug mode */
 static int rpt_do_debug(int fd, int argc, char *argv[]);
 static int rpt_do_dump(int fd, int argc, char *argv[]);
-static int rpt_do_frog(int fd, int argc, char *argv[]);
 
 static char debug_usage[] =
 "Usage: rpt debug level {0-7}\n"
@@ -618,10 +617,6 @@
 "Usage: rpt dump <nodename>\n"
 "       Dumps struct debug info to log\n";
 
-static char frog_usage[] =
-"Usage: frog [warp_factor]\n"
-"       Performs frog-in-a-blender calculations (Jacobsen Corollary)\n";
-
 static struct ast_cli_entry  cli_debug =
         { { "rpt", "debug", "level" }, rpt_do_debug, 
 		"Enable app_rpt debugging", debug_usage };
@@ -629,10 +624,6 @@
 static struct ast_cli_entry  cli_dump =
         { { "rpt", "dump" }, rpt_do_dump,
 		"Dump app_rpt structs for debugging", dump_usage };
-
-static struct ast_cli_entry  cli_frog =
-        { { "frog" }, rpt_do_frog,
-		"Perform frog-in-a-blender calculations", frog_usage };
 
 /*
 * Telemetry defaults
@@ -777,26 +768,6 @@
 		        return RESULT_SUCCESS;
 		}
 	}
-	return RESULT_FAILURE;
-}
-
-/*
-* Perform frong-in-a-blender calculations (Jacobsen Corollary) 
-*/
-                                                                                                                                 
-static int rpt_do_frog(int fd, int argc, char *argv[])
-{
-	double warpone = 75139293848.398696166028333356763;
-	double warpfactor = 1.0;
-
-        if (argc > 2) return RESULT_SHOWUSAGE;
-	if ((argc > 1) && (sscanf(argv[1],"%lf",&warpfactor) != 1))
-                return RESULT_SHOWUSAGE;
-
-        ast_cli(fd, "A frog in a blender with a base diameter of 3 inches going\n");
-        ast_cli(fd, "%lf RPM will be travelling at warp factor %lf,\n",
-		warpfactor * warpfactor * warpfactor * warpone,warpfactor);
-	ast_cli(fd,"based upon the Jacobsen Frog Corollary.\n");
 	return RESULT_FAILURE;
 }
 
@@ -7066,7 +7037,6 @@
 	/* Unregister cli extensions */
 	ast_cli_unregister(&cli_debug);
 	ast_cli_unregister(&cli_dump);
-	ast_cli_unregister(&cli_frog);
 
 	return i;
 }
@@ -7078,7 +7048,6 @@
 	/* Register cli extensions */
 	ast_cli_register(&cli_debug);
 	ast_cli_register(&cli_dump);
-	ast_cli_register(&cli_frog);
 
 	return ast_register_application(app, rpt_exec, synopsis, descrip);
 }

Modified: team/oej/sipregister/apps/app_senddtmf.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_senddtmf.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_senddtmf.c (original)
+++ team/oej/sipregister/apps/app_senddtmf.c Tue Apr  4 14:41:44 2006
@@ -52,7 +52,7 @@
 
 static char *descrip = 
 " SendDTMF(digits[|timeout_ms]): Sends DTMF digits on a channel. \n"
-" Accepted digits: 0-9, *#abcd\n"
+" Accepted digits: 0-9, *#abcd, w (.5s pause)\n"
 " The application will either pass the assigned digits or terminate if it\n"
 " encounters an error.\n";
 

Modified: team/oej/sipregister/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_sms.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_sms.c (original)
+++ team/oej/sipregister/apps/app_sms.c Tue Apr  4 14:41:44 2006
@@ -1177,32 +1177,31 @@
 {
 	struct ast_frame f = { 0 };
 	unsigned char waste[AST_FRIENDLY_OFFSET];
+#define MAXSAMPLES (800)
 #ifdef OUTALAW
-	unsigned char buf[800];
+	unsigned char buf[MAXSAMPLES];
 #else
-	signed short buf[800];
+	signed short buf[MAXSAMPLES];
 #endif
+#define SAMPLE2LEN (sizeof (buf[0]))
 	sms_t *h = data;
 	int i;
 
-	if (len > sizeof (buf)) {
-		ast_log (LOG_WARNING, "Only doing %d bytes (%d bytes requested)\n", (int)(sizeof (buf) / sizeof (signed short)), len);
-		len = sizeof (buf);
-#ifdef OUTALAW
-		samples = len;
-#else
-		samples = len / 2;
-#endif
-	}
-	waste[0] = 0;					 /* make compiler happy */
+	if (samples > MAXSAMPLES) {
+		ast_log (LOG_WARNING, "Only doing %d samples (%d requested)\n",
+			 MAXSAMPLES, samples);
+		samples = MAXSAMPLES;
+	}
+	len = samples * SAMPLE2LEN;
+
+	waste[0] = 0;				 /* make compiler happy */
 	f.frametype = AST_FRAME_VOICE;
 #ifdef OUTALAW
 	f.subclass = AST_FORMAT_ALAW;
-	f.datalen = samples;
 #else
 	f.subclass = AST_FORMAT_SLINEAR;
-	f.datalen = samples * 2;
 #endif
+	f.datalen = len;
 	f.offset = AST_FRIENDLY_OFFSET;
 	f.mallocd = 0;
 	f.data = buf;
@@ -1254,6 +1253,8 @@
 		return -1;
 	}
 	return 0;
+#undef SAMPLE2LEN
+#undef MAXSAMPLES
 }
 
 static void sms_process (sms_t * h, int samples, signed short *data)

Modified: team/oej/sipregister/apps/app_stack.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_stack.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_stack.c (original)
+++ team/oej/sipregister/apps/app_stack.c Tue Apr  4 14:41:44 2006
@@ -140,7 +140,7 @@
 	label1 = strsep(&args, ":");
 	label2 = args;
 
-	if (ast_true(condition)) {
+	if (pbx_checkcondition(condition)) {
 		if (label1) {
 			res = gosub_exec(chan, label1);
 		}

Modified: team/oej/sipregister/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_voicemail.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_voicemail.c (original)
+++ team/oej/sipregister/apps/app_voicemail.c Tue Apr  4 14:41:44 2006
@@ -3422,7 +3422,7 @@
 				old_priority = chan->priority;
 				
 				/* call the the Directory, changes the channel */
-				res = pbx_exec(chan, app, context ? context : "default", 1);
+				res = pbx_exec(chan, app, context ? context : "default");
 				
 				ast_copy_string(username, chan->exten, sizeof(username));
 				

Modified: team/oej/sipregister/apps/app_while.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/apps/app_while.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/apps/app_while.c (original)
+++ team/oej/sipregister/apps/app_while.c Tue Apr  4 14:41:44 2006
@@ -101,7 +101,7 @@
 
 		if (ast_true(expr)) { 
 			if ((app = pbx_findapp(myapp))) {
-				res = pbx_exec(chan, app, mydata, 1);
+				res = pbx_exec(chan, app, mydata);
 			} else {
 				ast_log(LOG_WARNING, "Count not find application! (%s)\n", myapp);
 				res = -1;

Modified: team/oej/sipregister/asterisk.8
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/asterisk.8?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/asterisk.8 (original)
+++ team/oej/sipregister/asterisk.8 Tue Apr  4 14:41:44 2006
@@ -9,7 +9,7 @@
 asterisk \- All-purpose telephony server.
 .SH SYNOPSIS
 
-\fBasterisk\fR [ \fB-tThfdvVqpRgcin\fR ] [ \fB-C \fIfile\fB\fR ] [ \fB-U \fIuser\fB\fR ] [ \fB-G \fIgroup\fB\fR ] [ \fB-x \fIcommand\fB\fR ] [ \fB-M \fIvalue\fB\fR ]
+\fBasterisk\fR [ \fB-tThfdvVqpRgciIn\fR ] [ \fB-C \fIfile\fB\fR ] [ \fB-U \fIuser\fB\fR ] [ \fB-G \fIgroup\fB\fR ] [ \fB-x \fIcommand\fB\fR ] [ \fB-M \fIvalue\fB\fR ]
 
 
 \fBasterisk -r\fR [ \fB-v\fR ] [ \fB-x \fIcommand\fB\fR ]
@@ -114,6 +114,12 @@
 for controlling it. Additionally, if connection to the Asterisk 
 process is lost, attempt to reconnect for as long as 30 seconds.
 .TP
+\fB-I\fR
+Enable internal timing if Zaptel timer is available
+The default behaviour is that outbound packets are phase locked
+to inbound packets. Enabling this switch causes them to be
+locked to the internal Zaptel timer instead.
+.TP
 \fB-t\fR
 When recording files, write them first into a temporary holding directory, 
 then move them into the final location when done.

Modified: team/oej/sipregister/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/asterisk.c?rev=17413&r1=17412&r2=17413&view=diff
==============================================================================
--- team/oej/sipregister/asterisk.c (original)
+++ team/oej/sipregister/asterisk.c Tue Apr  4 14:41:44 2006
@@ -30,7 +30,7 @@
  *
  * \section copyright Copyright and author
  *
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
  * Asterisk is a trade mark registered by Digium, Inc.
  *
  * \author Mark Spencer <markster at digium.com>
@@ -216,7 +216,7 @@
 char ast_config_AST_CTL_OWNER[AST_CONFIG_MAX_PATH] = "\0";
 char ast_config_AST_CTL_GROUP[AST_CONFIG_MAX_PATH] = "\0";
 char ast_config_AST_CTL[AST_CONFIG_MAX_PATH] = "asterisk.ctl";
-char ast_config_AST_SYSTEM_NAME[20]="";
+char ast_config_AST_SYSTEM_NAME[20] = "";
 
 static char *_argv[256];
 static int shuttingdown = 0;
@@ -462,7 +462,7 @@
 static void ast_network_puts(const char *string)
 {
 	int x;
-	for (x=0;x<AST_MAX_CONNECTS; x++) {
+	for (x=0; x < AST_MAX_CONNECTS; x++) {
 		if (consoles[x].fd > -1) 
 			fdprint(consoles[x].p[1], string);
 	}
@@ -503,7 +503,7 @@
 static void *netconsole(void *vconsole)
 {
 	struct console *con = vconsole;
-	char hostname[MAXHOSTNAMELEN]="";
+	char hostname[MAXHOSTNAMELEN] = "";
 	char tmp[512];
 	int res;
 	struct pollfd fds[2];
@@ -566,11 +566,11 @@
 	pthread_attr_t attr;
 	pthread_attr_init(&attr);
 	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-	for(;;) {
+	for (;;) {
 		if (ast_socket < 0)
 			return NULL;
 		fds[0].fd = ast_socket;

[... 19981 lines stripped ...]


More information about the asterisk-commits mailing list