[asterisk-commits] murf: branch murf/bug11210 r89318 - in /team/murf/bug11210: ./ apps/ channels...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Nov 15 18:32:47 CST 2007


Author: murf
Date: Thu Nov 15 18:32:45 2007
New Revision: 89318

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89318
Log:
Merged revisions 89247,89249-89253,89255-89259,89261-89266,89268-89274,89276-89279,89282-89283,89285,89287,89289-89291,89293-89295,89297,89299-89300,89303-89304,89312 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r89247 | tilghman | 2007-11-13 10:41:02 -0700 (Tue, 13 Nov 2007) | 10 lines

Merged revisions 89246 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89246 | tilghman | 2007-11-13 11:34:11 -0600 (Tue, 13 Nov 2007) | 2 lines

If we set a value for qualify, we should actually pay attention to it, instead of overriding the value

........

................
r89249 | qwell | 2007-11-13 12:48:41 -0700 (Tue, 13 Nov 2007) | 16 lines

Merged revisions 89248 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

(closes issue #11237)
........
r89248 | qwell | 2007-11-13 13:47:45 -0600 (Tue, 13 Nov 2007) | 7 lines

Revert change from revision 67064.
It is documented behavior that if a parking extension already exists while using PARKINGEXTEN,
 dialplan execution will continue.  If blind transferring to a Park with PARKINGEXTEN, you
 must keep this in mind, and handle the failure yourself.

Issue 11237, reported by jon.

........

................
r89250 | russell | 2007-11-13 13:30:13 -0700 (Tue, 13 Nov 2007) | 9 lines

Update the ParkedCall application to grab the first available parked call if no
parked extension is provided as an argument.

(closes issue #10803)
Reported by: outtolunc
Patches: 
      res_features-parkedcall-any.diff4 uploaded by outtolunc (license 237)
	  - modified by me to work a bit differently ...

................
r89251 | russell | 2007-11-13 13:53:49 -0700 (Tue, 13 Nov 2007) | 3 lines

- Convert initialization of a struct to C99 style instead of GNU style
- Fix a minor spelling error in a comment

................
r89252 | russell | 2007-11-13 13:56:32 -0700 (Tue, 13 Nov 2007) | 2 lines

Fix a typo pointed out by outtolunc, thanks :)

................
r89253 | russell | 2007-11-13 14:01:14 -0700 (Tue, 13 Nov 2007) | 3 lines

This fixes a build error on my mac.  It also works on my linux box.  Let me
know if it breaks any other platform ...

................
r89255 | qwell | 2007-11-13 14:08:23 -0700 (Tue, 13 Nov 2007) | 12 lines

Blocked revisions 89254 via svnmerge

(closes issue #11238)
........
r89254 | qwell | 2007-11-13 15:07:08 -0600 (Tue, 13 Nov 2007) | 4 lines

Fix building on newer systems which require a third arg to open() when using O_CREAT.

Issue 11238, reported by puzzled.

........

................
r89256 | murf | 2007-11-13 14:19:11 -0700 (Tue, 13 Nov 2007) | 1 line

closes issue #11233 -- where some fine points in the algorithm to build the tree needed to be corrected. Many thanks for the test case, jtodd
................
r89257 | murf | 2007-11-13 16:43:41 -0700 (Tue, 13 Nov 2007) | 1 line

This hopefully will fix the re-opened 11233. Hadn't covered the case of a context with no patterns. (blush)
................
r89258 | russell | 2007-11-13 17:33:52 -0700 (Tue, 13 Nov 2007) | 4 lines

- Simplify removing an item from a list
- move a verbose message to after the item is added to the list
- make use of the ARRAY_LEN macro in one spot

................
r89259 | kpfleming | 2007-11-13 17:54:38 -0700 (Tue, 13 Nov 2007) | 2 lines

use simpler technique for removing known entries from lists

................
r89261 | russell | 2007-11-13 18:15:26 -0700 (Tue, 13 Nov 2007) | 2 lines

Convert most of the strings in the call_queue struct to use stringfields.

................
r89262 | file | 2007-11-13 18:16:50 -0700 (Tue, 13 Nov 2007) | 12 lines

Merged revisions 89260 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89260 | file | 2007-11-13 21:15:12 -0400 (Tue, 13 Nov 2007) | 4 lines

Return the proper value when the srv_callback function executes properly.
(closes issue #11240)
Reported by: jtodd

........

................
r89263 | russell | 2007-11-13 18:35:28 -0700 (Tue, 13 Nov 2007) | 3 lines

Instead of reserving 800 bytes for periodic announcements, use an array of
ast_str pointers and only alloate space for the strings as needed.

................
r89264 | russell | 2007-11-13 18:40:47 -0700 (Tue, 13 Nov 2007) | 2 lines

Use BEGIN_OPTIONS / END_OPTIONS to make the syntax highlighting in my editor happy

................
r89265 | russell | 2007-11-13 19:57:13 -0700 (Tue, 13 Nov 2007) | 3 lines

- Use the ARRAY_LEN macro in a couple places
- return errors from load_module / unload_module

................
r89266 | russell | 2007-11-13 20:22:09 -0700 (Tue, 13 Nov 2007) | 6 lines

Fix up various coding guidelines issues ...
 - handle memory allocation failures
 - add an ast_ prefix to a publicly exported function
 - put curly braces in the right places
 - add a bunch of spaces where they should be be used

................
r89268 | rizzo | 2007-11-14 06:18:40 -0700 (Wed, 14 Nov 2007) | 18 lines

make the 'name' and 'value' fields in ast_variable const char *
 
This prevents modifying the strings in the stored variables, 
and catched a few instances where this was actually done.

Given the differences between trunk and 1.4 (and the fact that this
is effectively an API change) it is better to fix 1.4 independently.
These are

chan_sip.c::sip_register()
chan_skinny.c:: near line 2847
config.c:: near line 1774
logger.c::make_components()
res_adsi.c:: near line 1049

I may have missed some instances for modules that do not build here.


................
r89269 | tilghman | 2007-11-14 07:46:45 -0700 (Wed, 14 Nov 2007) | 2 lines

Typo

................
r89270 | tilghman | 2007-11-14 08:13:22 -0700 (Wed, 14 Nov 2007) | 2 lines

One more typo in config.c; and missed conversions due to the constifying of ast_variable_new parameters

................
r89271 | murf | 2007-11-14 08:43:30 -0700 (Wed, 14 Nov 2007) | 1 line

A further problem highlighted by 11233 has been resolved; a certain combination of patterns in a certain order, led to a malformed trie, due to a ptr not being initialized in the loop. Also, some tree printing prettifications.
................
r89272 | murf | 2007-11-14 11:05:50 -0700 (Wed, 14 Nov 2007) | 1 line

Rescaled the weights of the patterns to give something more independent of pattern length; and make . less likely to win. Question: which should win for 14102241145-- _1xxxxxxx.   or  _XXXXXXXXXXX  -- right now, the pure X pattern will win.
................
r89273 | tilghman | 2007-11-14 15:59:05 -0700 (Wed, 14 Nov 2007) | 5 lines

Add callerid to the Hangup manager event.
Reported by: outtolunc
Patch by: outtolunc
Closes issue #11248

................
r89274 | tilghman | 2007-11-14 16:08:54 -0700 (Wed, 14 Nov 2007) | 2 lines

Typo

................
r89276 | tilghman | 2007-11-14 17:01:22 -0700 (Wed, 14 Nov 2007) | 13 lines

Merged revisions 89275 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89275 | tilghman | 2007-11-14 17:23:58 -0600 (Wed, 14 Nov 2007) | 5 lines

When a recording ends with '#', we are improperly trimming an extra 200ms from the recording.
Reported by: sim
Patch by: tilghman
Closes issue #11247

........

................
r89277 | murf | 2007-11-14 18:42:12 -0700 (Wed, 14 Nov 2007) | 1 line

Had trouble playing with parking; spent a long time trying to reason out MATCHMORE mode. made these updates and xfers on zaptel lines seem to work ok now
................
r89278 | oej | 2007-11-15 03:21:41 -0700 (Thu, 15 Nov 2007) | 8 lines

Add support for application/dtmf SIP INFO dtmf handling. Yep, another
way of handling DTMF in SIP. Totally undocumented, but implemented
in enough devices so we have to support it. 

Code by sergee, small changes by oej.

Closes issue #11049

................
r89279 | oej | 2007-11-15 03:26:00 -0700 (Thu, 15 Nov 2007) | 2 lines

Exit early instead of deciding to exit after processing the message.

................
r89282 | oej | 2007-11-15 04:27:19 -0700 (Thu, 15 Nov 2007) | 13 lines

Merged revisions 89280 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89280 | oej | 2007-11-15 12:15:09 +0100 (Tor, 15 Nov 2007) | 5 lines

Improve support for multipart messages. Code by gasparz, changes
by me (mostly formatting). Thanks, gasparz!

Closes issue #10947

........

................
r89283 | oej | 2007-11-15 04:31:27 -0700 (Thu, 15 Nov 2007) | 14 lines

Merged revisions 89281 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89281 | oej | 2007-11-15 12:26:22 +0100 (Tor, 15 Nov 2007) | 6 lines

Don't send re-invites during pending INVITE transactions.

Patch by one47 - thanks!

Closes issue #9305

........

................
r89285 | oej | 2007-11-15 05:21:57 -0700 (Thu, 15 Nov 2007) | 5 lines

Always relying on the responses when crossing NAT's are not a good
solution, it breaks communication.
Rizzo - you need to implement a configuration option for this 
code. It's good, but maybe should be off by default.

................
r89287 | mmichelson | 2007-11-15 07:55:35 -0700 (Thu, 15 Nov 2007) | 12 lines

Merged revisions 89286 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89286 | mmichelson | 2007-11-15 08:54:10 -0600 (Thu, 15 Nov 2007) | 4 lines

Adding a missing mutex unlock.

(closes issue 11256, reported and patched by ys)

........

................
r89289 | mmichelson | 2007-11-15 07:58:30 -0700 (Thu, 15 Nov 2007) | 11 lines

Merged revisions 89288 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89288 | mmichelson | 2007-11-15 08:57:28 -0600 (Thu, 15 Nov 2007) | 3 lines

Undoing previous commit since I realize it was wrong


........

................
r89290 | file | 2007-11-15 08:21:04 -0700 (Thu, 15 Nov 2007) | 2 lines

And file said... let trunk build again! Accomplished by some more constification, and marking a function in chan_sip as purposely unused until it is fixed up.

................
r89291 | file | 2007-11-15 08:39:03 -0700 (Thu, 15 Nov 2007) | 2 lines

Fix typo in UPGRADE.txt. 'increase' should have been used, not 'increasing'.

................
r89293 | rizzo | 2007-11-15 09:20:47 -0700 (Thu, 15 Nov 2007) | 11 lines

access channel locks through ast_channel_lock/unlock/trylock and not
through ast_mutex primitives.

To detect all occurrences, I have renamed the lock field in struct ast_channel
so it is clear that it shouldn't be used directly.

There are some uses in res/res_features.c (see details of the diff)
that are error prone as they try and lock two channels without
caring about the order (or without explaining why it is safe).


................
r89294 | murf | 2007-11-15 09:30:13 -0700 (Thu, 15 Nov 2007) | 1 line

Perhaps I went overboard on initializing things. I can remove unnecc. stuff later. A few bug fixes. Killing small bugs on the way to killing bigger ones. Removed locking on hashtabs; there's plenty of locks already being taken. A small bug in the root_tree hashtab compare func.
................
r89295 | murf | 2007-11-15 09:50:16 -0700 (Thu, 15 Nov 2007) | 1 line

Get rid of a previously missed ast_log call for debug, no longer nec.
................
r89297 | russell | 2007-11-15 10:27:27 -0700 (Thu, 15 Nov 2007) | 16 lines

Merged revisions 89296 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89296 | russell | 2007-11-15 11:19:28 -0600 (Thu, 15 Nov 2007) | 8 lines

Update the SLAStation application to account for the case where the SLA thread
has a call out to the station,  but the user has pressed a line button to answer
the call instead of picking up the handset.  If they do, the phone sends out a
new INVITE.  So, the SLAStation app must check to see if it is picking up a
ringing trunk, and ensure that the other stations stop ringing.

(reported internally, patched by me, tested by mogorman)

........

................
r89299 | tilghman | 2007-11-15 11:11:36 -0700 (Thu, 15 Nov 2007) | 13 lines

Merged revisions 89298 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89298 | tilghman | 2007-11-15 12:05:56 -0600 (Thu, 15 Nov 2007) | 5 lines

Yet another memory corruption issue.
Reported by: atis
Patch by: tilghman
Fixes issue #10923

........

................
r89300 | tilghman | 2007-11-15 11:15:48 -0700 (Thu, 15 Nov 2007) | 2 lines

Fix trunk breakage due to chan->lock being renamed.

................
r89303 | tilghman | 2007-11-15 11:39:46 -0700 (Thu, 15 Nov 2007) | 10 lines

Merged revisions 89301 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89301 | tilghman | 2007-11-15 12:23:14 -0600 (Thu, 15 Nov 2007) | 2 lines

Fix an uninitialized memory read found by valgrind

........

................
r89304 | tilghman | 2007-11-15 11:49:31 -0700 (Thu, 15 Nov 2007) | 10 lines

Merged revisions 89302 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89302 | tilghman | 2007-11-15 12:37:38 -0600 (Thu, 15 Nov 2007) | 2 lines

Start Asterisk in Debian at a more reasonable time (since zaptel is at level 20)

........

................
r89312 | tilghman | 2007-11-15 16:50:15 -0700 (Thu, 15 Nov 2007) | 4 lines

If we're going to be passing a negative value for the size of a stringfield,
in order to indicate something, then using an UNSIGNED parameter is bad,
mmmmmkay?

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

Modified:
    team/murf/bug11210/   (props changed)
    team/murf/bug11210/CHANGES
    team/murf/bug11210/Makefile
    team/murf/bug11210/UPGRADE.txt
    team/murf/bug11210/apps/app_channelredirect.c
    team/murf/bug11210/apps/app_dial.c
    team/murf/bug11210/apps/app_directory.c
    team/murf/bug11210/apps/app_meetme.c
    team/murf/bug11210/apps/app_minivm.c
    team/murf/bug11210/apps/app_playback.c
    team/murf/bug11210/apps/app_queue.c
    team/murf/bug11210/apps/app_senddtmf.c
    team/murf/bug11210/apps/app_softhangup.c
    team/murf/bug11210/apps/app_voicemail.c
    team/murf/bug11210/apps/app_zapscan.c
    team/murf/bug11210/channels/chan_agent.c
    team/murf/bug11210/channels/chan_h323.c
    team/murf/bug11210/channels/chan_iax2.c
    team/murf/bug11210/channels/chan_oss.c
    team/murf/bug11210/channels/chan_phone.c
    team/murf/bug11210/channels/chan_sip.c
    team/murf/bug11210/channels/chan_skinny.c
    team/murf/bug11210/channels/chan_zap.c
    team/murf/bug11210/channels/misdn/isdn_lib.c
    team/murf/bug11210/channels/misdn_config.c
    team/murf/bug11210/configs/sip.conf.sample
    team/murf/bug11210/include/asterisk/abstract_jb.h
    team/murf/bug11210/include/asterisk/acl.h
    team/murf/bug11210/include/asterisk/channel.h
    team/murf/bug11210/include/asterisk/config.h
    team/murf/bug11210/include/asterisk/hashtab.h
    team/murf/bug11210/include/asterisk/lock.h
    team/murf/bug11210/include/asterisk/stringfields.h
    team/murf/bug11210/main/abstract_jb.c
    team/murf/bug11210/main/acl.c
    team/murf/bug11210/main/app.c
    team/murf/bug11210/main/channel.c
    team/murf/bug11210/main/config.c
    team/murf/bug11210/main/enum.c
    team/murf/bug11210/main/hashtab.c
    team/murf/bug11210/main/image.c
    team/murf/bug11210/main/logger.c
    team/murf/bug11210/main/manager.c
    team/murf/bug11210/main/pbx.c
    team/murf/bug11210/main/srv.c
    team/murf/bug11210/main/utils.c
    team/murf/bug11210/pbx/dundi-parser.c
    team/murf/bug11210/pbx/dundi-parser.h
    team/murf/bug11210/pbx/pbx_dundi.c
    team/murf/bug11210/res/res_adsi.c
    team/murf/bug11210/res/res_clioriginate.c
    team/murf/bug11210/res/res_config_sqlite.c
    team/murf/bug11210/res/res_features.c
    team/murf/bug11210/res/res_jabber.c
    team/murf/bug11210/res/res_odbc.c

Propchange: team/murf/bug11210/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/murf/bug11210/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/murf/bug11210/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Nov 15 18:32:45 2007
@@ -1,1 +1,1 @@
-/trunk:1-89243
+/trunk:1-89317

Modified: team/murf/bug11210/CHANGES
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/CHANGES?view=diff&rev=89318&r1=89317&r2=89318
==============================================================================
--- team/murf/bug11210/CHANGES (original)
+++ team/murf/bug11210/CHANGES Thu Nov 15 18:32:45 2007
@@ -255,6 +255,9 @@
      features.conf.  This means that features can be written a single time, and
      then mapped into groups of features for different key mappings or easier
      access control.
+  * Updated the ParkedCall application to allow you to not specify a parking
+     extension.  If you don't specify a parking space to pick up, it will grab
+     the first one available.
 
 Language Support Changes
 ------------------------

Modified: team/murf/bug11210/Makefile
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/Makefile?view=diff&rev=89318&r1=89317&r2=89318
==============================================================================
--- team/murf/bug11210/Makefile (original)
+++ team/murf/bug11210/Makefile Thu Nov 15 18:32:45 2007
@@ -668,11 +668,11 @@
 			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
 		elif [ -f /etc/debian_version ]; then \
 			$(INSTALL) -m 755 contrib/init.d/rc.debian.asterisk $(DESTDIR)/etc/init.d/asterisk; \
-			if [ -z "$(DESTDIR)" ]; then /usr/sbin/update-rc.d asterisk start 10 2 3 4 5 . stop 91 2 3 4 5 .; fi; \
+			if [ -z "$(DESTDIR)" ]; then /usr/sbin/update-rc.d asterisk start 50 2 3 4 5 . stop 91 2 3 4 5 .; fi; \
 		elif [ -f /etc/gentoo-release ]; then \
 			$(INSTALL) -m 755 contrib/init.d/rc.gentoo.asterisk $(DESTDIR)/etc/init.d/asterisk; \
 			if [ -z "$(DESTDIR)" ]; then /sbin/rc-update add asterisk default; fi; \
-		elif [ -f /etc/mandrake-release ]; then \
+		elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ]; then \
 			$(INSTALL) -m 755 contrib/init.d/rc.mandrake.asterisk $(DESTDIR)/etc/rc.d/init.d/asterisk; \
 			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
 		elif [ -f /etc/SuSE-release -o -f /etc/novell-release ]; then \

Modified: team/murf/bug11210/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/UPGRADE.txt?view=diff&rev=89318&r1=89317&r2=89318
==============================================================================
--- team/murf/bug11210/UPGRADE.txt (original)
+++ team/murf/bug11210/UPGRADE.txt Thu Nov 15 18:32:45 2007
@@ -98,7 +98,7 @@
 
 * format_wav: The GAIN preprocessor definition and source code that used it
   is removed.  This change was made in response to user complaints of
-  choppiness or the clipping of loud signal peaks.  To increasing the volume
+  choppiness or the clipping of loud signal peaks.  To increase the volume
   of voicemail messages, use the 'volgain' option in voicemail.conf
 
 Channel Drivers:

Modified: team/murf/bug11210/apps/app_channelredirect.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_channelredirect.c?view=diff&rev=89318&r1=89317&r2=89318
==============================================================================
--- team/murf/bug11210/apps/app_channelredirect.c (original)
+++ team/murf/bug11210/apps/app_channelredirect.c Thu Nov 15 18:32:45 2007
@@ -81,7 +81,7 @@
 
 	res = ast_parseable_goto(chan2, args.label);
 
-	ast_mutex_unlock(&chan2->lock);
+	ast_channel_unlock(chan2);
 quit:
 
 	return res;

Modified: team/murf/bug11210/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_dial.c?view=diff&rev=89318&r1=89317&r2=89318
==============================================================================
--- team/murf/bug11210/apps/app_dial.c (original)
+++ team/murf/bug11210/apps/app_dial.c Thu Nov 15 18:32:45 2007
@@ -277,7 +277,7 @@
 	OPT_ARG_ARRAY_SIZE,
 };
 
-AST_APP_OPTIONS(dial_exec_options, {
+AST_APP_OPTIONS(dial_exec_options, BEGIN_OPTIONS
 	AST_APP_OPTION_ARG('A', OPT_ANNOUNCE, OPT_ARG_ANNOUNCE),
 	AST_APP_OPTION('C', OPT_RESETCDR),
 	AST_APP_OPTION('c', OPT_CANCEL_ELSEWHERE),
@@ -310,7 +310,7 @@
 	AST_APP_OPTION_ARG('U', OPT_CALLEE_GOSUB, OPT_ARG_CALLEE_GOSUB),
 	AST_APP_OPTION('w', OPT_CALLEE_MONITOR),
 	AST_APP_OPTION('W', OPT_CALLER_MONITOR),
-});
+END_OPTIONS );
 
 #define CAN_EARLY_BRIDGE(flags) (!ast_test_flag64(flags, OPT_CALLEE_HANGUP | \
 	OPT_CALLER_HANGUP | OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER | \

Modified: team/murf/bug11210/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_directory.c?view=diff&rev=89318&r1=89317&r2=89318
==============================================================================
--- team/murf/bug11210/apps/app_directory.c (original)
+++ team/murf/bug11210/apps/app_directory.c Thu Nov 15 18:32:45 2007
@@ -277,8 +277,8 @@
  *           '1' for selected entry from directory
  *           '*' for skipped entry from directory
  */
-static int play_mailbox_owner(struct ast_channel *chan, char *context,
-		char *dialcontext, char *ext, char *name, int readext,
+static int play_mailbox_owner(struct ast_channel *chan, const char *context,
+		const char *dialcontext, const char *ext, const char *name, int readext,
 		int fromappvm)
 {
 	int res = 0;

Modified: team/murf/bug11210/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_meetme.c?view=diff&rev=89318&r1=89317&r2=89318
==============================================================================
--- team/murf/bug11210/apps/app_meetme.c (original)
+++ team/murf/bug11210/apps/app_meetme.c Thu Nov 15 18:32:45 2007
@@ -4821,6 +4821,29 @@
 			ast_devstate_changed(AST_DEVICE_INUSE, 
 				"SLA:%s_%s", station->name, trunk_ref->trunk->name);
 		}
+	} else if (trunk_ref->state == SLA_TRUNK_STATE_RINGING) {
+		struct sla_ringing_trunk *ringing_trunk;
+
+		ast_mutex_lock(&sla.lock);
+		AST_LIST_TRAVERSE_SAFE_BEGIN(&sla.ringing_trunks, ringing_trunk, entry) {
+			if (ringing_trunk->trunk == trunk_ref->trunk) {
+				AST_LIST_REMOVE_CURRENT(entry);
+				break;
+			}
+		}
+		AST_LIST_TRAVERSE_SAFE_END
+		ast_mutex_unlock(&sla.lock);
+
+		if (ringing_trunk) {
+			ast_answer(ringing_trunk->trunk->chan);
+			sla_change_trunk_state(ringing_trunk->trunk, SLA_TRUNK_STATE_UP, ALL_TRUNK_REFS, NULL);
+
+			free(ringing_trunk);
+
+			/* Queue up reprocessing ringing trunks, and then ringing stations again */
+			sla_queue_event(SLA_EVENT_RINGING_TRUNK);
+			sla_queue_event(SLA_EVENT_DIAL_STATE);
+		}
 	}
 
 	trunk_ref->chan = chan;

Modified: team/murf/bug11210/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_minivm.c?view=diff&rev=89318&r1=89317&r2=89318
==============================================================================
--- team/murf/bug11210/apps/app_minivm.c (original)
+++ team/murf/bug11210/apps/app_minivm.c Thu Nov 15 18:32:45 2007
@@ -458,7 +458,7 @@
 #define DEFAULT_CHARSET		"ISO-8859-1"
 
 /* Forward declarations */
-static char *message_template_parse_filebody(char *filename);
+static char *message_template_parse_filebody(const char *filename);
 static char *message_template_parse_emailbody(const char *body);
 static int create_vmaccount(char *name, struct ast_variable *var, int realtime);
 static struct minivm_account *find_user_realtime(const char *domain, const char *username);
@@ -2182,7 +2182,7 @@
 }
 
 /*! \brief Add time zone to memory list */
-static int timezone_add(char *zonename, char *config)
+static int timezone_add(const char *zonename, const char *config)
 {
 
 	struct minivm_zone *newzone;
@@ -2220,7 +2220,7 @@
 }
 
 /*! \brief Read message template from file */
-static char *message_template_parse_filebody(char *filename) {
+static char *message_template_parse_filebody(const char *filename) {
 	char buf[BUFSIZ * 6];
 	char readbuf[BUFSIZ];
 	char filenamebuf[BUFSIZ];

Modified: team/murf/bug11210/apps/app_playback.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_playback.c?view=diff&rev=89318&r1=89317&r2=89318
==============================================================================
--- team/murf/bug11210/apps/app_playback.c (original)
+++ team/murf/bug11210/apps/app_playback.c Thu Nov 15 18:32:45 2007
@@ -325,7 +325,7 @@
 /*
  * remap the 'say' functions to use those in this file
  */
-static int say_init_mode(char *mode) {
+static int say_init_mode(const char *mode) {
 	if (!strcmp(mode, say_new)) {
 		if (say_cfg == NULL) {
 			ast_log(LOG_ERROR, "There is no say.conf file to use new mode\n");

Modified: team/murf/bug11210/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_queue.c?view=diff&rev=89318&r1=89317&r2=89318
==============================================================================
--- team/murf/bug11210/apps/app_queue.c (original)
+++ team/murf/bug11210/apps/app_queue.c Thu Nov 15 18:32:45 2007
@@ -94,6 +94,7 @@
 #include "asterisk/stringfields.h"
 #include "asterisk/event.h"
 #include "asterisk/astobj2.h"
+#include "asterisk/strings.h"
 
 enum {
 	QUEUE_STRATEGY_RINGALL = 0,
@@ -367,10 +368,42 @@
 #define QUEUE_EVENT_VARIABLES 3
 
 struct call_queue {
-	char name[80];                      /*!< Name */
-	char moh[80];                       /*!< Music On Hold class to be used */
-	char announce[80];                  /*!< Announcement to play when call is answered */
-	char context[AST_MAX_CONTEXT];      /*!< Exit context */
+	AST_DECLARE_STRING_FIELDS(
+		/*! Queue name */
+		AST_STRING_FIELD(name);
+		/*! Music on Hold class */
+		AST_STRING_FIELD(moh);
+		/*! Announcement to play when call is answered */
+		AST_STRING_FIELD(announce);
+		/*! Exit context */
+		AST_STRING_FIELD(context);
+		/*! Macro to run upon member connection */
+		AST_STRING_FIELD(membermacro);
+		/*! Gosub to run upon member connection */
+		AST_STRING_FIELD(membergosub);
+		/*! Sound file: "Your call is now first in line" (def. queue-youarenext) */
+		AST_STRING_FIELD(sound_next);
+		/*! Sound file: "There are currently" (def. queue-thereare) */
+		AST_STRING_FIELD(sound_thereare);
+		/*! Sound file: "calls waiting to speak to a representative." (def. queue-callswaiting) */
+		AST_STRING_FIELD(sound_calls);
+		/*! Sound file: "The current estimated total holdtime is" (def. queue-holdtime) */
+		AST_STRING_FIELD(sound_holdtime);
+		/*! Sound file: "minutes." (def. queue-minutes) */
+		AST_STRING_FIELD(sound_minutes);
+		/*! Sound file: "less-than" (def. queue-lessthan) */
+		AST_STRING_FIELD(sound_lessthan);
+		/*! Sound file: "seconds." (def. queue-seconds) */
+		AST_STRING_FIELD(sound_seconds);
+		/*! Sound file: "Thank you for your patience." (def. queue-thankyou) */
+		AST_STRING_FIELD(sound_thanks);
+		/*! Sound file: Custom announce for caller, no default */
+		AST_STRING_FIELD(sound_callerannounce);
+		/*! Sound file: "Hold time" (def. queue-reporthold) */
+		AST_STRING_FIELD(sound_reporthold);
+	);
+	/*! Sound files: Custom announce, no default */
+	struct ast_str *sound_periodicannounce[MAX_PERIODIC_ANNOUNCEMENTS];
 	unsigned int dead:1;
 	unsigned int joinempty:2;
 	unsigned int eventwhencalled:2;
@@ -399,20 +432,6 @@
 	int callscompletedinsl;             /*!< Number of calls answered with servicelevel*/
 	char monfmt[8];                     /*!< Format to use when recording calls */
 	int montype;                        /*!< Monitor type  Monitor vs. MixMonitor */
-	char membermacro[32];               /*!< Macro to run upon member connection */
-	char membergosub[32];               /*!< Gosub to run upon member connection */
-	char sound_next[80];                /*!< Sound file: "Your call is now first in line" (def. queue-youarenext) */
-	char sound_thereare[80];            /*!< Sound file: "There are currently" (def. queue-thereare) */
-	char sound_calls[80];               /*!< Sound file: "calls waiting to speak to a representative." (def. queue-callswaiting)*/
-	char sound_holdtime[80];            /*!< Sound file: "The current estimated total holdtime is" (def. queue-holdtime) */
-	char sound_minutes[80];             /*!< Sound file: "minutes." (def. queue-minutes) */
-	char sound_lessthan[80];            /*!< Sound file: "less-than" (def. queue-lessthan) */
-	char sound_seconds[80];             /*!< Sound file: "seconds." (def. queue-seconds) */
-	char sound_thanks[80];              /*!< Sound file: "Thank you for your patience." (def. queue-thankyou) */
-	char sound_callerannounce[80];      /*!< Sound file: Custom announce for caller, no default */
-	char sound_reporthold[80];          /*!< Sound file: "Hold time" (def. queue-reporthold) */
-	char sound_periodicannounce[MAX_PERIODIC_ANNOUNCEMENTS][80];/*!< Sound files: Custom announce, no default */
-
 	int count;                          /*!< How many entries */
 	int maxlen;                         /*!< Max number of entries */
 	int wrapuptime;                     /*!< Wrapup Time */
@@ -831,14 +850,8 @@
 	q->setqueueentryvar = 0;
 	q->autofill = autofill_default;
 	q->montype = montype_default;
-	q->membermacro[0] = '\0';
-	q->membergosub[0] = '\0';
-	q->moh[0] = '\0';
-	q->announce[0] = '\0';
-	q->context[0] = '\0';
 	q->monfmt[0] = '\0';
 	q->periodicannouncefrequency = 0;
-	q->sound_callerannounce[0] = '\0';	/* Default, don't announce the caller that he has been answered */
 	if(!q->members) {
 		if(q->strategy == QUEUE_STRATEGY_LINEAR)
 			/* linear strategy depends on order, so we have to place all members in a single bucket */
@@ -848,18 +861,23 @@
 	}
 	q->membercount = 0;
 	q->found = 1;
-	ast_copy_string(q->sound_next, "queue-youarenext", sizeof(q->sound_next));
-	ast_copy_string(q->sound_thereare, "queue-thereare", sizeof(q->sound_thereare));
-	ast_copy_string(q->sound_calls, "queue-callswaiting", sizeof(q->sound_calls));
-	ast_copy_string(q->sound_holdtime, "queue-holdtime", sizeof(q->sound_holdtime));
-	ast_copy_string(q->sound_minutes, "queue-minutes", sizeof(q->sound_minutes));
-	ast_copy_string(q->sound_seconds, "queue-seconds", sizeof(q->sound_seconds));
-	ast_copy_string(q->sound_thanks, "queue-thankyou", sizeof(q->sound_thanks));
-	ast_copy_string(q->sound_lessthan, "queue-less-than", sizeof(q->sound_lessthan));
-	ast_copy_string(q->sound_reporthold, "queue-reporthold", sizeof(q->sound_reporthold));
-	ast_copy_string(q->sound_periodicannounce[0], "queue-periodic-announce", sizeof(q->sound_periodicannounce[0]));
+
+	ast_string_field_set(q, sound_next, "queue-youarenext");
+	ast_string_field_set(q, sound_thereare, "queue-thereare");
+	ast_string_field_set(q, sound_calls, "queue-callswaiting");
+	ast_string_field_set(q, sound_holdtime, "queue-holdtime");
+	ast_string_field_set(q, sound_minutes, "queue-minutes");
+	ast_string_field_set(q, sound_seconds, "queue-seconds");
+	ast_string_field_set(q, sound_thanks, "queue-thankyou");
+	ast_string_field_set(q, sound_lessthan, "queue-less-than");
+	ast_string_field_set(q, sound_reporthold, "queue-reporthold");
+
+	if ((q->sound_periodicannounce[0] = ast_str_create(32)))
+		ast_str_set(&q->sound_periodicannounce[0], 0, "queue-periodic-announce");
+
 	for (i = 1; i < MAX_PERIODIC_ANNOUNCEMENTS; i++) {
-		q->sound_periodicannounce[i][0]='\0';
+		if (q->sound_periodicannounce[i])
+			ast_str_set(&q->sound_periodicannounce[i], 0, "%s", "");
 	}
 }
 
@@ -966,11 +984,11 @@
 {
 	if (!strcasecmp(param, "musicclass") || 
 		!strcasecmp(param, "music") || !strcasecmp(param, "musiconhold")) {
-		ast_copy_string(q->moh, val, sizeof(q->moh));
+		ast_string_field_set(q, moh, val);
 	} else if (!strcasecmp(param, "announce")) {
-		ast_copy_string(q->announce, val, sizeof(q->announce));
+		ast_string_field_set(q, announce, val);
 	} else if (!strcasecmp(param, "context")) {
-		ast_copy_string(q->context, val, sizeof(q->context));
+		ast_string_field_set(q, context, val);
 	} else if (!strcasecmp(param, "timeout")) {
 		q->timeout = atoi(val);
 		if (q->timeout < 0)
@@ -986,29 +1004,29 @@
 	} else if (!strcasecmp(param, "monitor-format")) {
 		ast_copy_string(q->monfmt, val, sizeof(q->monfmt));
 	} else if (!strcasecmp(param, "membermacro")) {
-		ast_copy_string(q->membermacro, val, sizeof(q->membermacro));
+		ast_string_field_set(q, membermacro, val);
 	} else if (!strcasecmp(param, "membergosub")) {
-		ast_copy_string(q->membergosub, val, sizeof(q->membergosub));
+		ast_string_field_set(q, membergosub, val);
 	} else if (!strcasecmp(param, "queue-youarenext")) {
-		ast_copy_string(q->sound_next, val, sizeof(q->sound_next));
+		ast_string_field_set(q, sound_next, val);
 	} else if (!strcasecmp(param, "queue-thereare")) {
-		ast_copy_string(q->sound_thereare, val, sizeof(q->sound_thereare));
+		ast_string_field_set(q, sound_thereare, val);
 	} else if (!strcasecmp(param, "queue-callswaiting")) {
-		ast_copy_string(q->sound_calls, val, sizeof(q->sound_calls));
+		ast_string_field_set(q, sound_calls, val);
 	} else if (!strcasecmp(param, "queue-holdtime")) {
-		ast_copy_string(q->sound_holdtime, val, sizeof(q->sound_holdtime));
+		ast_string_field_set(q, sound_holdtime, val);
 	} else if (!strcasecmp(param, "queue-minutes")) {
-		ast_copy_string(q->sound_minutes, val, sizeof(q->sound_minutes));
+		ast_string_field_set(q, sound_minutes, val);
 	} else if (!strcasecmp(param, "queue-seconds")) {
-		ast_copy_string(q->sound_seconds, val, sizeof(q->sound_seconds));
+		ast_string_field_set(q, sound_seconds, val);
 	} else if (!strcasecmp(param, "queue-lessthan")) {
-		ast_copy_string(q->sound_lessthan, val, sizeof(q->sound_lessthan));
+		ast_string_field_set(q, sound_lessthan, val);
 	} else if (!strcasecmp(param, "queue-thankyou")) {
-		ast_copy_string(q->sound_thanks, val, sizeof(q->sound_thanks));
+		ast_string_field_set(q, sound_thanks, val);
 	} else if (!strcasecmp(param, "queue-callerannounce")) {
-		ast_copy_string(q->sound_callerannounce, val, sizeof(q->sound_callerannounce));
+		ast_string_field_set(q, sound_callerannounce, val);
 	} else if (!strcasecmp(param, "queue-reporthold")) {
-		ast_copy_string(q->sound_reporthold, val, sizeof(q->sound_reporthold));
+		ast_string_field_set(q, sound_reporthold, val);
 	} else if (!strcasecmp(param, "announce-frequency")) {
 		q->announcefrequency = atoi(val);
 	} else if (!strcasecmp(param, "min-announce-frequency")) {
@@ -1044,13 +1062,15 @@
 			unsigned int i = 0;
 
 			while ((s = strsep(&buf, ",|"))) {
-				ast_copy_string(q->sound_periodicannounce[i], s, sizeof(q->sound_periodicannounce[i]));
+				if (!q->sound_periodicannounce[i])
+					q->sound_periodicannounce[i] = ast_str_create(16);
+				ast_str_set(&q->sound_periodicannounce[i], 0, s);
 				i++;
 				if (i == MAX_PERIODIC_ANNOUNCEMENTS)
 					break;
 			}
 		} else {
-			ast_copy_string(q->sound_periodicannounce[0], val, sizeof(q->sound_periodicannounce[0]));
+			ast_str_set(&q->sound_periodicannounce[0], 0, val);
 		}
 	} else if (!strcasecmp(param, "periodic-announce-frequency")) {
 		q->periodicannouncefrequency = atoi(val);
@@ -1183,8 +1203,16 @@
 static void destroy_queue(void *obj)
 {
 	struct call_queue *q = obj;
+	int i;
+
 	ast_debug(0, "Queue destructor called for queue '%s'!\n", q->name);
+
 	free_members(q, 1);
+	ast_string_field_free_memory(q);
+	for (i = 0; i < MAX_PERIODIC_ANNOUNCEMENTS; i++) {
+		if (q->sound_periodicannounce[i])
+			free(q->sound_periodicannounce[i]);
+	}
 	ao2_ref(q->members, -1);
 }
 
@@ -1193,7 +1221,11 @@
 	struct call_queue *q;
 
 	if ((q = ao2_alloc(sizeof(*q), destroy_queue))) {
-		ast_copy_string(q->name, queuename, sizeof(q->name));
+		if (ast_string_field_init(q, 64)) {
+			free(q);
+			return NULL;
+		}
+		ast_string_field_set(q, name, queuename);
 	}
 	return q;
 }
@@ -1204,15 +1236,15 @@
 static struct call_queue *find_queue_by_name_rt(const char *queuename, struct ast_variable *queue_vars, struct ast_config *member_config)
 {
 	struct ast_variable *v;
-	struct call_queue *q, tmpq;
+	struct call_queue *q, tmpq = {
+		.name = queuename,	
+	};
 	struct member *m;
 	struct ao2_iterator mem_iter;
 	char *interface = NULL;
-	char *tmp, *tmp_name;
+	const char *tmp_name;
+	char *tmp;
 	char tmpbuf[64];	/* Must be longer than the longest queue param name. */
-
-	/* Find the queue in the in-core list (we will create a new one if not found). */
-	ast_copy_string(tmpq.name, queuename, sizeof(tmpq.name));
 
 	/* Static queues override realtime. */
 	if ((q = ao2_find(queues, &tmpq, OBJ_POINTER))) {
@@ -1269,7 +1301,7 @@
 		if ((tmp = strchr(v->name, '_'))) {
 			ast_copy_string(tmpbuf, v->name, sizeof(tmpbuf));
 			tmp_name = tmpbuf;
-			tmp = tmp_name;
+			tmp = tmpbuf;
 			while ((tmp = strchr(tmp, '_')))
 				*tmp++ = '-';
 		} else
@@ -1316,10 +1348,11 @@
 {
 	struct ast_variable *queue_vars;
 	struct ast_config *member_config = NULL;
-	struct call_queue *q = NULL, tmpq;
+	struct call_queue *q = NULL, tmpq = {
+		.name = queuename,	
+	};
 
 	/* Find the queue in the in-core list first. */
-	ast_copy_string(tmpq.name, queuename, sizeof(tmpq.name));
 	q = ao2_find(queues, &tmpq, OBJ_POINTER);
 
 	if (!q || q->realtime) {
@@ -1486,7 +1519,7 @@
 	return res;
 }
 
-static int play_file(struct ast_channel *chan, char *filename)
+static int play_file(struct ast_channel *chan, const char *filename)
 {
 	int res;
 
@@ -2097,12 +2130,14 @@
 	ast_verb(3, "Playing periodic announcement\n");
 
 	/* Check to make sure we have a sound file. If not, reset to the first sound file */
-	if (qe->last_periodic_announce_sound >= MAX_PERIODIC_ANNOUNCEMENTS || ast_strlen_zero(qe->parent->sound_periodicannounce[qe->last_periodic_announce_sound])) {
+	if (qe->last_periodic_announce_sound >= MAX_PERIODIC_ANNOUNCEMENTS || 
+		!qe->parent->sound_periodicannounce[qe->last_periodic_announce_sound] ||
+		ast_strlen_zero(qe->parent->sound_periodicannounce[qe->last_periodic_announce_sound]->str)) {
 		qe->last_periodic_announce_sound = 0;
 	}
 	
 	/* play the announcement */
-	res = play_file(qe->chan, qe->parent->sound_periodicannounce[qe->last_periodic_announce_sound]);
+	res = play_file(qe->chan, qe->parent->sound_periodicannounce[qe->last_periodic_announce_sound]->str);
 
 	if ((res > 0 && !valid_exit(qe, res)) || res < 0)
 		res = 0;
@@ -2159,7 +2194,7 @@
 
 static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callattempt *outgoing, int *to, char *digit, int prebusies, int caller_disconnect, int forwardsallowed)
 {
-	char *queue = qe->parent->name;
+	const char *queue = qe->parent->name;
 	struct callattempt *o;
 	int status;
 	int sentringing = 0;
@@ -2630,7 +2665,7 @@
 	const struct ast_channel *peer, const struct member *member, time_t callstart,
 	char *vars, size_t vars_len, enum agent_complete_reason rsn)
 {
-	const char *reason;
+	const char *reason = NULL;	/* silence dumb compilers */
 
 	if (!qe->parent->eventwhencalled)
 		return;
@@ -3283,13 +3318,14 @@
 
 static int remove_from_queue(const char *queuename, const char *interface)
 {
-	struct call_queue *q, tmpq;
+	struct call_queue *q, tmpq = {
+		.name = queuename,	
+	};
 	struct member *mem, tmpmem;
 	int res = RES_NOSUCHQUEUE;
 
 	ast_copy_string(tmpmem.interface, interface, sizeof(tmpmem.interface));
-	ast_copy_string(tmpq.name, queuename, sizeof(tmpq.name));
-	if((q = ao2_find(queues, &tmpq, OBJ_POINTER))) {
+	if ((q = ao2_find(queues, &tmpq, OBJ_POINTER))) {
 		ao2_lock(q);
 		if ((mem = ao2_find(q->members, &tmpmem, OBJ_POINTER))) {
 			/* XXX future changes should beware of this assumption!! */
@@ -3481,11 +3517,12 @@
 static int get_member_penalty(char *queuename, char *interface)
 {
 	int foundqueue = 0, penalty;
-	struct call_queue *q, tmpq;
+	struct call_queue *q, tmpq = {
+		.name = queuename,	
+	};
 	struct member *mem;
 	

[... 2900 lines stripped ...]



More information about the asterisk-commits mailing list