[svn-commits] branch bweschke/queue_improvements r16392 - in /team/bweschke/queue_improveme...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Mar 29 20:53:01 MST 2006


Author: bweschke
Date: Wed Mar 29 21:52:49 2006
New Revision: 16392

URL: http://svn.digium.com/view/asterisk?rev=16392&view=rev
Log:
Merged revisions 15319,15375,15377,15379-15380,15382,15435-15436,15476,15514,15516-15519,15543,15550-15551,15581,15614,15616-15619,15659,15662,15701-15702,15704,15744-15745,15784-15785,15815-15820,15852,15856-15860,15895,15897,15905,15938,15969-15970,16006-16007,16009-16012,16051,16083,16085,16124,16129,16161,16193,16195,16234-16235,16268,16304-16305,16345,16347,16386 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r15319 | north | 2006-03-27 15:13:54 -0600 (Mon, 27 Mar 2006) | 4 lines

Changed some "register" methods to the proper "unregister" method.  This is in a #if 0 block, but it may still be useful someday.

Thanks eliel.

................
r15375 | oej | 2006-03-27 17:13:31 -0600 (Mon, 27 Mar 2006) | 2 lines

Issue #6409 - Make calls to URI without username go to "s" extension (imported from 1.2)

................
r15377 | oej | 2006-03-27 17:32:34 -0600 (Mon, 27 Mar 2006) | 2 lines

Issue #6597 - Show correct port in "sip show registry" - import from 1.2 branch

................
r15379 | oej | 2006-03-27 17:39:48 -0600 (Mon, 27 Mar 2006) | 2 lines

Issue #6736 - Enable NAT flags for OPTIONs requests (Thanks casper!)

................
r15380 | oej | 2006-03-27 17:41:21 -0600 (Mon, 27 Mar 2006) | 2 lines

Reverting previous patch. Ok, let's take this from 1.2 instead... :-)

................
r15382 | oej | 2006-03-27 17:49:44 -0600 (Mon, 27 Mar 2006) | 2 lines

Issue #6736 - use flags for OPTIONs messages

................
r15435 | kpfleming | 2006-03-27 21:28:52 -0600 (Mon, 27 Mar 2006) | 2 lines

improve IP TOS support for SIP and IAX2 (issue #6355, code from jcollie plus modifications)

................
r15436 | kpfleming | 2006-03-27 21:36:17 -0600 (Mon, 27 Mar 2006) | 2 lines

use proper file name

................
r15476 | kpfleming | 2006-03-27 22:21:21 -0600 (Mon, 27 Mar 2006) | 2 lines

support subscription-based MWI, and use proper Call-ID on NOTIFY messages (issue #6390)

................
r15514 | rizzo | 2006-03-28 07:23:05 -0600 (Tue, 28 Mar 2006) | 3 lines

fix documentation


................
r15516 | rizzo | 2006-03-28 07:46:04 -0600 (Tue, 28 Mar 2006) | 5 lines

optimize a bit name completion by avoiding repeated calls to
strlen(word), localize variables and normalize the test
for finding the candidate string.


................
r15517 | rizzo | 2006-03-28 07:52:04 -0600 (Tue, 28 Mar 2006) | 4 lines

remove the long since unused STANDARD_LOCAL_USERS macro
so that new apps will not try to use it by mistake.


................
r15518 | russell | 2006-03-28 07:52:57 -0600 (Tue, 28 Mar 2006) | 2 lines

disable the http server by default at the request of people on IRC

................
r15519 | rizzo | 2006-03-28 07:58:34 -0600 (Tue, 28 Mar 2006) | 3 lines

remove trailing whitespace


................
r15543 | rizzo | 2006-03-28 08:04:27 -0600 (Tue, 28 Mar 2006) | 3 lines

update example file


................
r15550 | rizzo | 2006-03-28 08:15:13 -0600 (Tue, 28 Mar 2006) | 4 lines

Use the standard macros to manipulate usecount.
This is in preparation to the import of the new loader.


................
r15551 | rizzo | 2006-03-28 08:30:31 -0600 (Tue, 28 Mar 2006) | 4 lines

remove a few unneeded calls to strlen, and replace a while()
loop with the equivalent function strchr()


................
r15581 | rizzo | 2006-03-28 09:19:32 -0600 (Tue, 28 Mar 2006) | 9 lines

- remove an unnecessary cast and recomputation of (timeout - now);
- remove useless recomputations of strlen(word) in a loop, and
  normalize the form of complete_peer_helper();
- move LOCAL_USER_ADD() to after the verification of arguments,
  thus removing the need for one LOCAL_USER_REMOVE() call.

The three chunks of the patch are fully disjoint.


................
r15614 | oej | 2006-03-28 11:18:02 -0600 (Tue, 28 Mar 2006) | 2 lines

Fix typo (thanks, North) and update docs for IP-tos settings

................
r15616 | tilghman | 2006-03-28 11:49:39 -0600 (Tue, 28 Mar 2006) | 10 lines

Merged revisions 15615 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r15615 | tilghman | 2006-03-28 11:48:18 -0600 (Tue, 28 Mar 2006) | 2 lines

Bug 6815 - Adding quotes to make bash happy

........

................
r15617 | russell | 2006-03-28 11:52:50 -0600 (Tue, 28 Mar 2006) | 2 lines

conversions to S_OR (issue #6817)

................
r15618 | kpfleming | 2006-03-28 11:53:27 -0600 (Tue, 28 Mar 2006) | 2 lines

oops :-(

................
r15619 | russell | 2006-03-28 12:00:05 -0600 (Tue, 28 Mar 2006) | 2 lines

store f->callno in a local var (issue #6818)

................
r15659 | russell | 2006-03-28 12:13:53 -0600 (Tue, 28 Mar 2006) | 10 lines

Merged revisions 15658 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r15658 | russell | 2006-03-28 13:09:05 -0500 (Tue, 28 Mar 2006) | 2 lines

fix the order in which for loops are expanded (issue #6810)

........

................
r15662 | kpfleming | 2006-03-28 13:00:21 -0600 (Tue, 28 Mar 2006) | 2 lines

ensure that 'zap show channel' will indicate that the echo canceler has been disabled when CED has been detected on the channel

................
r15701 | oej | 2006-03-28 13:09:51 -0600 (Tue, 28 Mar 2006) | 3 lines

Fix NAT support breakage for peers with qualify=yes (imported from 1.2)
- Blame KLM, still jetlagged :-)

................
r15702 | russell | 2006-03-28 13:31:41 -0600 (Tue, 28 Mar 2006) | 2 lines

only display a debug message if iaxdebug is enabled as well (issue #6673)

................
r15704 | russell | 2006-03-28 13:49:30 -0600 (Tue, 28 Mar 2006) | 10 lines

Merged revisions 15703 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r15703 | russell | 2006-03-28 14:47:03 -0500 (Tue, 28 Mar 2006) | 2 lines

fix Bus Error on sparc (issue #6354)

........

................
r15744 | rizzo | 2006-03-28 14:22:25 -0600 (Tue, 28 Mar 2006) | 5 lines

fix a bug introduced in 15187 that scrambled the flags and
among other things prevented proper handling of NAT.
Don't think it exist in 1.2 but be careful if 15187 is merged.


................
r15745 | russell | 2006-03-28 14:24:08 -0600 (Tue, 28 Mar 2006) | 1 line


................
r15784 | rizzo | 2006-03-28 15:15:10 -0600 (Tue, 28 Mar 2006) | 9 lines

Bring in the new loader code as described in mantis #4377
and updated to today's version.

The core of the patch is only two files, loader.c
and include/asterisk/module.h, with the other files
touched only to adapt non-standard usages of the
reference counts and localuser lists.


................
r15785 | rizzo | 2006-03-28 15:24:48 -0600 (Tue, 28 Mar 2006) | 11 lines

The condition to check the zaptel version was too strict.
If you are compiling with WITHOUT_ZAPTEL=1, you can also
work with older version of zaptel, and there is no reason
not to allow that.

This should help various people mentioning on the -dev
list that there were issues with newer zaptel versions
on FreeBSD, and so they had to use older version.
(This includes me, btw!)


................
r15815 | kpfleming | 2006-03-28 16:09:38 -0600 (Tue, 28 Mar 2006) | 2 lines

make 'show hints' CLI command show context name for each hint

................
r15816 | kpfleming | 2006-03-28 16:14:50 -0600 (Tue, 28 Mar 2006) | 2 lines

let's format that output sanely instead :-(

................
r15817 | rizzo | 2006-03-28 16:25:08 -0600 (Tue, 28 Mar 2006) | 12 lines

bring in the code that was discussed on Mantis #6068,
which is the basis for several simplifications and fixes
to the CLI interfaces.

The core is in cli.c, some documentation on a new function
to help command completion is in cli.h, and one line of
glue code in the other two files.

Next step is to bring in the patches described in #6066 and
other simplifications.


................
r15818 | rizzo | 2006-03-28 16:44:55 -0600 (Tue, 28 Mar 2006) | 4 lines

as reported in mantis #6066, fix a bunch of cli bugs and
inconsistencies.


................
r15819 | kpfleming | 2006-03-28 16:47:02 -0600 (Tue, 28 Mar 2006) | 2 lines

make 'sip show subscriptions' include context for subscribed hints

................
r15820 | rizzo | 2006-03-28 16:59:34 -0600 (Tue, 28 Mar 2006) | 3 lines

black magic to make sure we recompile things after the changes to cli.c


................
r15852 | rizzo | 2006-03-28 17:06:46 -0600 (Tue, 28 Mar 2006) | 3 lines

use ast_cli_complete() to largely simplify the command completion code.


................
r15856 | rizzo | 2006-03-28 17:20:13 -0600 (Tue, 28 Mar 2006) | 3 lines

normalize/simplify a bit of the command completion code.


................
r15857 | rizzo | 2006-03-28 17:33:02 -0600 (Tue, 28 Mar 2006) | 3 lines

another batch of cli simplifications


................
r15858 | rizzo | 2006-03-28 17:40:28 -0600 (Tue, 28 Mar 2006) | 3 lines

more command completion normalization


................
r15859 | rizzo | 2006-03-28 17:52:21 -0600 (Tue, 28 Mar 2006) | 4 lines

more command completion normalization.
also change some explicit constant with sizeof()


................
r15860 | oej | 2006-03-28 17:55:52 -0600 (Tue, 28 Mar 2006) | 2 lines

Doxygen fixes 

................
r15895 | rizzo | 2006-03-28 18:30:29 -0600 (Tue, 28 Mar 2006) | 6 lines

Normalize some cli completion code.
On passing, replace strdup with ast_strdup() and remove
the now useless checks for NULL since ast_strdup() can handle
it correctly.


................
r15897 | kpfleming | 2006-03-28 18:32:52 -0600 (Tue, 28 Mar 2006) | 10 lines

Merged revisions 15896 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r15896 | kpfleming | 2006-03-28 18:32:10 -0600 (Tue, 28 Mar 2006) | 2 lines

ensure that list traversal loops which skip entries properly update the 'previous entry' pointer so when entries _are_ removed the list does not get damaged

........

................
r15905 | oej | 2006-03-28 19:01:09 -0600 (Tue, 28 Mar 2006) | 2 lines

Issue #6823 - Registration and port numbers. (from 1.2)

................
r15938 | north | 2006-03-28 19:08:01 -0600 (Tue, 28 Mar 2006) | 2 lines

Added more "valid" phone types to skinny sample config.

................
r15969 | rizzo | 2006-03-28 20:12:31 -0600 (Tue, 28 Mar 2006) | 10 lines

Add two widely used constants

#define DEFAULT_SAMPLE_RATE 8000
#define DEFAULT_SAMPLES_PER_MS  ((DEFAULT_SAMPLE_RATE)/1000)

to the main header, and remove equivalent ones from plc.[ch]

This will simplify the cleanup of the codec/ and formats/ files.


................
r15970 | rizzo | 2006-03-28 20:14:38 -0600 (Tue, 28 Mar 2006) | 4 lines

Introduce an utility macro to set base, offset and
datalen of a frame, which is a very common operation.


................
r16006 | russell | 2006-03-28 22:09:31 -0600 (Tue, 28 Mar 2006) | 2 lines

conversion from malloc to ast_malloc

................
r16007 | russell | 2006-03-28 22:14:12 -0600 (Tue, 28 Mar 2006) | 2 lines

fix the provided unsetenv for solaris to return an int like it's supposed to

................
r16009 | russell | 2006-03-28 22:16:09 -0600 (Tue, 28 Mar 2006) | 1 line


................
r16010 | russell | 2006-03-28 22:19:23 -0600 (Tue, 28 Mar 2006) | 1 line

oops!  :)
................
r16011 | oej | 2006-03-28 22:34:55 -0600 (Tue, 28 Mar 2006) | 3 lines

- Formatting fixes
- Doxygen

................
r16012 | oej | 2006-03-28 22:42:07 -0600 (Tue, 28 Mar 2006) | 2 lines

Doxygen updates

................
r16051 | markster | 2006-03-28 23:12:24 -0600 (Tue, 28 Mar 2006) | 2 lines

Fix build of asterisk again (ahem, committers!)

................
r16083 | tilghman | 2006-03-29 08:24:30 -0600 (Wed, 29 Mar 2006) | 10 lines

Merged revisions 16082 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r16082 | tilghman | 2006-03-29 08:10:23 -0600 (Wed, 29 Mar 2006) | 2 lines

Bug 6835 - Updates to GotoIf help text

........

................
r16085 | crichter | 2006-03-29 08:26:43 -0600 (Wed, 29 Mar 2006) | 1 line

fixed no dtmf detect on 64 bit
................
r16124 | rizzo | 2006-03-29 10:00:51 -0600 (Wed, 29 Mar 2006) | 5 lines

mention issues with the protection of the list used in indications.c

(part of work done to figure out what is used and what is not in lock.h)


................
r16129 | rizzo | 2006-03-29 10:51:51 -0600 (Wed, 29 Mar 2006) | 3 lines

another batch of cli simplifications.


................
r16161 | oej | 2006-03-29 11:09:33 -0600 (Wed, 29 Mar 2006) | 2 lines

Update to code documentation and developer guidelines.

................
r16193 | tilghman | 2006-03-29 13:30:57 -0600 (Wed, 29 Mar 2006) | 10 lines

Merged revisions 16192 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r16192 | tilghman | 2006-03-29 13:11:18 -0600 (Wed, 29 Mar 2006) | 2 lines

Bug 6830 - Let GosubIf work with the same conditions as a GotoIf (change in API approved by Russell)

........

................
r16195 | russell | 2006-03-29 13:54:41 -0600 (Wed, 29 Mar 2006) | 2 lines

convert calloc and malloc+memset to ast_calloc and remove duplicate error messages

................
r16234 | oej | 2006-03-29 14:08:14 -0600 (Wed, 29 Mar 2006) | 2 lines

Whitespace fix forgotten by someone who added a note about needing to fix this...

................
r16235 | rizzo | 2006-03-29 14:09:10 -0600 (Wed, 29 Mar 2006) | 3 lines

the comment character is ';' not '#' ...


................
r16268 | north | 2006-03-29 15:08:13 -0600 (Wed, 29 Mar 2006) | 4 lines

whitespace "fixes", and general cleanup

It's nice to have consistency in sample configs too.

................
r16304 | oej | 2006-03-29 18:30:49 -0600 (Wed, 29 Mar 2006) | 2 lines

Formatting fix.

................
r16305 | oej | 2006-03-29 18:32:01 -0600 (Wed, 29 Mar 2006) | 2 lines

Typo

................
r16345 | oej | 2006-03-29 19:30:15 -0600 (Wed, 29 Mar 2006) | 2 lines

Block patch on app_groupcount.c from 1.2

................
r16347 | oej | 2006-03-29 19:35:56 -0600 (Wed, 29 Mar 2006) | 2 lines

Set default value of adsipark (import from 1.2)

................
r16386 | file | 2006-03-29 21:16:09 -0600 (Wed, 29 Mar 2006) | 2 lines

Fix IAX2 multithreaded scheduling (issue #6840)

................

Added:
    team/bweschke/queue_improvements/doc/ip-tos.txt   (props changed)
      - copied unchanged from r16386, trunk/doc/ip-tos.txt
Modified:
    team/bweschke/queue_improvements/   (props changed)
    team/bweschke/queue_improvements/.cleancount
    team/bweschke/queue_improvements/acl.c
    team/bweschke/queue_improvements/app.c
    team/bweschke/queue_improvements/apps/app_channelredirect.c
    team/bweschke/queue_improvements/apps/app_meetme.c
    team/bweschke/queue_improvements/apps/app_queue.c
    team/bweschke/queue_improvements/apps/app_rpt.c
    team/bweschke/queue_improvements/apps/app_stack.c
    team/bweschke/queue_improvements/asterisk.c
    team/bweschke/queue_improvements/callerid.c
    team/bweschke/queue_improvements/channels/chan_agent.c
    team/bweschke/queue_improvements/channels/chan_iax2.c
    team/bweschke/queue_improvements/channels/chan_oss.c
    team/bweschke/queue_improvements/channels/chan_sip.c
    team/bweschke/queue_improvements/channels/chan_skinny.c
    team/bweschke/queue_improvements/channels/chan_zap.c
    team/bweschke/queue_improvements/channels/iax2-provision.c
    team/bweschke/queue_improvements/channels/misdn/isdn_lib.c
    team/bweschke/queue_improvements/cli.c
    team/bweschke/queue_improvements/codecs/codec_a_mu.c
    team/bweschke/queue_improvements/codecs/codec_adpcm.c
    team/bweschke/queue_improvements/codecs/codec_alaw.c
    team/bweschke/queue_improvements/codecs/codec_g723_1.c
    team/bweschke/queue_improvements/codecs/codec_g726.c
    team/bweschke/queue_improvements/codecs/codec_gsm.c
    team/bweschke/queue_improvements/codecs/codec_ilbc.c
    team/bweschke/queue_improvements/codecs/codec_lpc10.c
    team/bweschke/queue_improvements/codecs/codec_speex.c
    team/bweschke/queue_improvements/codecs/codec_ulaw.c
    team/bweschke/queue_improvements/configs/extensions.conf.sample
    team/bweschke/queue_improvements/configs/http.conf.sample
    team/bweschke/queue_improvements/configs/iax.conf.sample
    team/bweschke/queue_improvements/configs/iaxprov.conf.sample
    team/bweschke/queue_improvements/configs/oss.conf.sample
    team/bweschke/queue_improvements/configs/sip.conf.sample
    team/bweschke/queue_improvements/configs/skinny.conf.sample
    team/bweschke/queue_improvements/contrib/init.d/rc.redhat.asterisk
    team/bweschke/queue_improvements/include/asterisk.h
    team/bweschke/queue_improvements/include/asterisk/acl.h
    team/bweschke/queue_improvements/include/asterisk/callerid.h
    team/bweschke/queue_improvements/include/asterisk/cli.h
    team/bweschke/queue_improvements/include/asterisk/frame.h
    team/bweschke/queue_improvements/include/asterisk/linkedlists.h
    team/bweschke/queue_improvements/include/asterisk/module.h
    team/bweschke/queue_improvements/include/asterisk/pbx.h
    team/bweschke/queue_improvements/include/asterisk/plc.h
    team/bweschke/queue_improvements/include/solaris-compat/compat.h
    team/bweschke/queue_improvements/indications.c
    team/bweschke/queue_improvements/loader.c
    team/bweschke/queue_improvements/manager.c
    team/bweschke/queue_improvements/pbx.c
    team/bweschke/queue_improvements/pbx/pbx_ael.c
    team/bweschke/queue_improvements/pbx/pbx_config.c
    team/bweschke/queue_improvements/pbx/pbx_dundi.c
    team/bweschke/queue_improvements/plc.c
    team/bweschke/queue_improvements/res/res_clioriginate.c
    team/bweschke/queue_improvements/res/res_features.c
    team/bweschke/queue_improvements/res/res_smdi.c
    team/bweschke/queue_improvements/slinfactory.c
    team/bweschke/queue_improvements/strcompat.c
    team/bweschke/queue_improvements/translate.c
    team/bweschke/queue_improvements/utils/astman.c

Propchange: team/bweschke/queue_improvements/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Propchange: team/bweschke/queue_improvements/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/bweschke/queue_improvements/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Mar 29 21:52:49 2006
@@ -1,1 +1,1 @@
-/trunk:1-15283
+/trunk:1-16391

Modified: team/bweschke/queue_improvements/.cleancount
URL: http://svn.digium.com/view/asterisk/team/bweschke/queue_improvements/.cleancount?rev=16392&r1=16391&r2=16392&view=diff
==============================================================================
--- team/bweschke/queue_improvements/.cleancount (original)
+++ team/bweschke/queue_improvements/.cleancount Wed Mar 29 21:52:49 2006
@@ -1,1 +1,1 @@
-11
+12

Modified: team/bweschke/queue_improvements/acl.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/queue_improvements/acl.c?rev=16392&r1=16391&r2=16392&view=diff
==============================================================================
--- team/bweschke/queue_improvements/acl.c (original)
+++ team/bweschke/queue_improvements/acl.c Wed Mar 29 21:52:49 2006
@@ -1,7 +1,7 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
  *
  * Mark Spencer <markster at digium.com>
  *
@@ -20,7 +20,7 @@
  *
  * \brief Various sorts of access control
  *
- * \author Mark Spencer <markster at digium.com> 
+ * \author Mark Spencer <markster at digium.com>
  */
 
 #include <stdio.h>
@@ -136,7 +136,7 @@
 		if (prev)
 			prev->next = link;		/* Link previous to this object */
 
-		if (!ret) 
+		if (!ret)
 			ret = link;		/* Save starting point */
 
 		start = start->next;		/* Go to next object */
@@ -153,7 +153,7 @@
 	struct ast_ha *prev = NULL;
 	struct ast_ha *ret;
 	int x, z;
-	unsigned int y;		
+	unsigned int y;
 
 	ret = path;
 	while (path) {
@@ -252,12 +252,55 @@
 	return 0;
 }
 
-int ast_str2tos(const char *value, int *tos)
+struct dscp_codepoint {
+	char *name;
+	unsigned int space;
+};
+
+/* IANA registered DSCP codepoints */
+
+static const struct dscp_codepoint dscp_pool1[] = {
+	{ "CS0", 0x00 },
+	{ "CS1", 0x08 },
+	{ "CS2", 0x10 },
+	{ "CS3", 0x18 },
+	{ "CS4", 0x20 },
+	{ "CS5", 0x28 },
+	{ "CS6", 0x30 },
+	{ "CS7", 0x38 },
+	{ "AF11", 0x0A },
+	{ "AF12", 0x0C },
+	{ "AF13", 0x0E },
+	{ "AF21", 0x12 },
+	{ "AF22", 0x14 },
+	{ "AF23", 0x16 },
+	{ "AF31", 0x1A },
+	{ "AF32", 0x1C },
+	{ "AF33", 0x1E },
+	{ "AF41", 0x22 },
+	{ "AF42", 0x24 },
+	{ "AF43", 0x26 },
+	{ "EF", 0x2E },
+};
+
+int ast_str2tos(const char *value, unsigned int *tos)
 {
 	int fval;
-	if (sscanf(value, "%i", &fval) == 1)
-		*tos = fval & 0xff;
-	else if (!strcasecmp(value, "lowdelay"))
+	unsigned int x;
+
+	if (sscanf(value, "%i", &fval) == 1) {
+		*tos = fval & 0xFF;
+		return 0;
+	}
+
+	for (x = 0; x < sizeof(dscp_pool1) / sizeof(dscp_pool1[0]); x++) {
+		if (!strcasecmp(value, dscp_pool1[x].name)) {
+			*tos = dscp_pool1[x].space << 2;
+			return 0;
+		}
+	}
+
+	if (!strcasecmp(value, "lowdelay"))
 		*tos = IPTOS_LOWDELAY;
 	else if (!strcasecmp(value, "throughput"))
 		*tos = IPTOS_THROUGHPUT;
@@ -269,16 +312,44 @@
 		*tos = 0;
 	else
 		return -1;
+
+	ast_log(LOG_WARNING, "TOS value %s is deprecated. Please see doc/ip-tos.txt for more information.\n", value);
+
 	return 0;
 }
 
+const char *ast_tos2str(unsigned int tos)
+{
+	unsigned int x;
+
+	switch (tos) {
+	case 0:
+		return "none";
+	case IPTOS_LOWDELAY:
+		return "lowdelay";
+	case IPTOS_THROUGHPUT:
+		return "throughput";
+	case IPTOS_RELIABILITY:
+		return "reliability";
+	case IPTOS_MINCOST:
+		return "mincost";
+	default:
+		for (x = 0; x < sizeof(dscp_pool1) / sizeof(dscp_pool1[0]); x++) {
+			if (dscp_pool1[x].space == (tos >> 2))
+				return dscp_pool1[x].name;
+		}
+	}
+
+	return "unknown";
+}
+
 int ast_get_ip(struct sockaddr_in *sin, const char *value)
 {
 	return ast_get_ip_or_srv(sin, value, NULL);
 }
 
 /* iface is the interface (e.g. eth0); address is the return value */
-int ast_lookup_iface(char *iface, struct in_addr *address) 
+int ast_lookup_iface(char *iface, struct in_addr *address)
 {
 	int mysock, res = 0;
 	struct my_ifreq ifreq;
@@ -357,4 +428,3 @@
 		return 0;
 	return -1;
 }
-

Modified: team/bweschke/queue_improvements/app.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/queue_improvements/app.c?rev=16392&r1=16391&r2=16392&view=diff
==============================================================================
--- team/bweschke/queue_improvements/app.c (original)
+++ team/bweschke/queue_improvements/app.c Wed Mar 29 21:52:49 2006
@@ -79,7 +79,7 @@
 	else 
 		ast_log(LOG_NOTICE,"Huh....? no dial for indications?\n");
 	
-	for (x = strlen(collect); strlen(collect) < maxlen; ) {
+	for (x = strlen(collect); x < maxlen; ) {
 		res = ast_waitfordigit(chan, timeout);
 		if (!ast_ignore_pattern(context, collect))
 			ast_playtones_stop(chan);
@@ -94,12 +94,8 @@
 			break;
 		}
 	}
-	if (res >= 0) {
-		if (ast_exists_extension(chan, context, collect, 1, chan->cid.cid_num))
-			res = 1;
-		else
-			res = 0;
-	}
+	if (res >= 0)
+		res = ast_exists_extension(chan, context, collect, 1, chan->cid.cid_num) ? 1 : 0;
 	return res;
 }
 
@@ -1153,9 +1149,10 @@
 	char *fs;
 	int res;
 	int fd;
+	int lp = strlen(path);
 	time_t start;
 
-	if (!(s = alloca(strlen(path) + 10)) || !(fs = alloca(strlen(path) + 20))) {
+	if (!(s = alloca(lp + 10)) || !(fs = alloca(lp + 20))) {
 		ast_log(LOG_WARNING, "Out of memory!\n");
 		return AST_LOCK_FAILURE;
 	}
@@ -1510,7 +1507,7 @@
 	if (fd < 0) {
 		ast_log(LOG_WARNING, "Cannot open file '%s' for reading: %s\n", filename, strerror(errno));
 		return NULL;
-	}	
+	}
 	if ((output = ast_malloc(count))) {
 		res = read(fd, output, count - 1);
 		if (res == count - 1) {
@@ -1540,14 +1537,13 @@
 
 	s = optstr;
 	while (*s) {
-		curarg = *s++ & 0x7f;
+		curarg = *s++ & 0x7f;	/* the array (in app.h) has 128 entries */
 		ast_set_flag(flags, options[curarg].flag);
 		argloc = options[curarg].arg_index;
 		if (*s == '(') {
 			/* Has argument */
 			arg = ++s;
-			while (*s && (*s != ')'))
-				s++;
+			s = strchr(s, ')');
 			if (*s) {
 				if (argloc)
 					args[argloc - 1] = arg;

Modified: team/bweschke/queue_improvements/apps/app_channelredirect.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/queue_improvements/apps/app_channelredirect.c?rev=16392&r1=16391&r2=16392&view=diff
==============================================================================
--- team/bweschke/queue_improvements/apps/app_channelredirect.c (original)
+++ team/bweschke/queue_improvements/apps/app_channelredirect.c Wed Mar 29 21:52:49 2006
@@ -47,8 +47,6 @@
 static char *descrip = 
 "ChannelRedirect(channel|[[context|]extension|]priority):\n"
 "  Sends the specified channel to the specified extension priority\n";
-
-STANDARD_LOCAL_USER;
 
 LOCAL_USER_DECL;
 

Modified: team/bweschke/queue_improvements/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/queue_improvements/apps/app_meetme.c?rev=16392&r1=16391&r2=16392&view=diff
==============================================================================
--- team/bweschke/queue_improvements/apps/app_meetme.c (original)
+++ team/bweschke/queue_improvements/apps/app_meetme.c Wed Mar 29 21:52:49 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);

Modified: team/bweschke/queue_improvements/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/queue_improvements/apps/app_queue.c?rev=16392&r1=16391&r2=16392&view=diff
==============================================================================
--- team/bweschke/queue_improvements/apps/app_queue.c (original)
+++ team/bweschke/queue_improvements/apps/app_queue.c Wed Mar 29 21:52:49 2006
@@ -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);
@@ -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) 
@@ -2682,7 +2668,7 @@
 	}
 
 	if (!(parse = ast_strdupa(data))) 
-		return -1;	
+		return -1;
 
 	AST_STANDARD_APP_ARGS(args, parse);
 
@@ -3501,8 +3487,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 +3752,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 +3809,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/bweschke/queue_improvements/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/queue_improvements/apps/app_rpt.c?rev=16392&r1=16391&r2=16392&view=diff
==============================================================================
--- team/bweschke/queue_improvements/apps/app_rpt.c (original)
+++ team/bweschke/queue_improvements/apps/app_rpt.c Wed Mar 29 21:52:49 2006
@@ -260,7 +260,6 @@
 
 struct	ast_config *cfg;
 
-STANDARD_LOCAL_USER;
 LOCAL_USER_DECL;
 
 #define	MSWAIT 200

Modified: team/bweschke/queue_improvements/apps/app_stack.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/queue_improvements/apps/app_stack.c?rev=16392&r1=16391&r2=16392&view=diff
==============================================================================
--- team/bweschke/queue_improvements/apps/app_stack.c (original)
+++ team/bweschke/queue_improvements/apps/app_stack.c Wed Mar 29 21:52:49 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/bweschke/queue_improvements/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/queue_improvements/asterisk.c?rev=16392&r1=16391&r2=16392&view=diff
==============================================================================
--- team/bweschke/queue_improvements/asterisk.c (original)
+++ team/bweschke/queue_improvements/asterisk.c Wed Mar 29 21:52:49 2006
@@ -2031,6 +2031,7 @@
 	ast_ulaw_init();
 	ast_alaw_init();
 	callerid_init();
+	ast_builtins_init();
 	ast_utils_init();
 	tdd_init();
 	/* When Asterisk restarts after it has dropped the root privileges,

Modified: team/bweschke/queue_improvements/callerid.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/queue_improvements/callerid.c?rev=16392&r1=16391&r2=16392&view=diff
==============================================================================
--- team/bweschke/queue_improvements/callerid.c (original)
+++ team/bweschke/queue_improvements/callerid.c Wed Mar 29 21:52:49 2006
@@ -42,6 +42,7 @@
 #include "asterisk/callerid.h"
 #include "asterisk/logger.h"
 #include "asterisk/fskmodem.h"
+#include "asterisk/options.h"
 #include "asterisk/utils.h"
 
 struct callerid_state {
@@ -219,7 +220,7 @@
 			"parsing might be unreliable\n");
 		for (i = 0; i < strlen(cidstring); i++) {
 			if (isdigit(cidstring[i]))
-                                number[i] = cidstring[i];
+				number[i] = cidstring[i];
 			else
 				break;
 		}
@@ -254,21 +255,24 @@
 
 static unsigned short calc_crc(unsigned short crc, unsigned char data)
 {
-   	unsigned int i, j, org, dst;
-   	org = data;
-   	dst = 0;
-   	for (i=0; i<CHAR_BIT; i++) {
-       	org <<= 1;
-       	dst >>= 1;
-       	if (org & 0x100) {
-           	dst |= 0x80;
-       	}
-   	}
-   	data = (unsigned char)dst;
+	unsigned int i, j, org, dst;
+	org = data;
+	dst = 0;
+
+	for (i=0; i < CHAR_BIT; i++) {
+		org <<= 1;
+		dst >>= 1;
+		if (org & 0x100) {
+			dst |= 0x80;
+		}
+	}
+	data = (unsigned char)dst;
 	crc ^= (unsigned int)data << (16 - CHAR_BIT);
 	for ( j=0; j<CHAR_BIT; j++ ) {
-		if ( crc & 0x8000U ) crc = (crc << 1) ^ 0x1021U ;
-		else crc <<= 1 ;
+		if ( crc & 0x8000U )
+			crc = (crc << 1) ^ 0x1021U ;
+		else
+			crc <<= 1 ;
 	}
    	return crc;
 }
@@ -296,7 +300,7 @@
 		buf[x+cid->oldlen/2] = AST_XLAW(ubuf[x]);
 
 	while (mylen >= 160) {
-        b = b2 = 0 ;
+	b = b2 = 0 ;
 		olen = mylen;
 		res = fsk_serie(&cid->fskd, buf, &mylen, &b);
 
@@ -407,103 +411,108 @@
 					/* extract caller id data */
 					for (x=0; x<cid->pos; ) {
 						switch (cid->rawdata[x++]) {
-							case 0x02: /* caller id  number */
-								cid->number[0] = '\0';
-								cid->name[0] = '\0';
-								cid->flags = 0;
-								res = cid->rawdata[x++];
-								ast_copy_string(cid->number, &cid->rawdata[x], res+1 );
-                                x += res;
-								break;
-							case 0x21: /* additional information */
-								/* length */
-                                x++; 
-								/* number type */
-                           		switch (cid->rawdata[x]) { 
-									case 0x00: /* unknown */
-									case 0x01: /* international number */
-									case 0x02: /* domestic number */
-									case 0x03: /* network */
-									case 0x04: /* local call */
-									case 0x06: /* short dial number */
-									case 0x07: /* reserved */
-									default:   /* reserved */
-										ast_log(LOG_NOTICE, "cid info:#1=%X\n", cid->rawdata[x]);
-										break ;
-								}
-                                x++; 
-								/* numbering plan octed 4 */
-                                x++; 
-								/* numbering plan octed 5 */
-                           		switch (cid->rawdata[x]) { 
-									case 0x00: /* unknown */
-									case 0x01: /* recommendation E.164 ISDN */
-									case 0x03: /* recommendation X.121 */
-									case 0x04: /* telex dial plan */
-									case 0x08: /* domestic dial plan */
-									case 0x09: /* private dial plan */
-									case 0x05: /* reserved */
-									default:   /* reserved */
-										ast_log(LOG_NOTICE, "cid info:#2=%X\n", cid->rawdata[x]);
-										break ;
-								}
-                                x++; 
+						case 0x02: /* caller id  number */
+							cid->number[0] = '\0';
+							cid->name[0] = '\0';
+							cid->flags = 0;
+							res = cid->rawdata[x++];
+							ast_copy_string(cid->number, &cid->rawdata[x], res+1 );
+							x += res;
+							break;
+						case 0x21: /* additional information */
+							/* length */
+							x++; 
+							/* number type */
+                        		   		switch (cid->rawdata[x]) { 
+							case 0x00: /* unknown */
+							case 0x01: /* international number */
+							case 0x02: /* domestic number */
+							case 0x03: /* network */
+							case 0x04: /* local call */
+							case 0x06: /* short dial number */
+							case 0x07: /* reserved */
+							default:   /* reserved */
+								if (option_debug > 1)
+									ast_log(LOG_DEBUG, "cid info:#1=%X\n", cid->rawdata[x]);
 								break ;
-							case 0x04: /* no callerid reason */
-								/* length */
-                                x++; 
-								/* no callerid reason code */
-                            	switch (cid->rawdata[x]) {
-									case 'P': /* caller id denied by user */
-									case 'O': /* service not available */
-									case 'C': /* pay phone */
-									case 'S': /* service congested */
-                    					cid->flags |= CID_UNKNOWN_NUMBER;
-										ast_log(LOG_NOTICE, "no cid reason:%c\n",cid->rawdata[x]);
-										break ;
-								}
-                                x++; 
+							}
+							x++; 
+							/* numbering plan octed 4 */
+							x++; 
+							/* numbering plan octed 5 */
+							switch (cid->rawdata[x]) { 
+							case 0x00: /* unknown */
+							case 0x01: /* recommendation E.164 ISDN */
+							case 0x03: /* recommendation X.121 */
+							case 0x04: /* telex dial plan */
+							case 0x08: /* domestic dial plan */

[... 7389 lines stripped ...]


More information about the svn-commits mailing list