[svn-commits] sruffell: branch sruffell/asterisk-1.4-transcoder r136110 - in /team/sruffell...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Aug 6 11:46:37 CDT 2008


Author: sruffell
Date: Wed Aug  6 11:46:36 2008
New Revision: 136110

URL: http://svn.digium.com/view/asterisk?view=rev&rev=136110
Log:
Merged revisions 134254,134352,134475,134480,134536,134540,134595,134649,134652,134704,134758,134814,134883,134915,134976,134983,135055,135058,135473,135479,135482,135536,135597,135747,135799,135841,135847,135850,135899,135915,135949,136062 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r134254 | kpfleming | 2008-07-29 15:05:57 -0700 (Tue, 29 Jul 2008) | 2 lines

build against the now-typedef-free dahdi/user.h

........
r134352 | kpfleming | 2008-07-30 08:29:17 -0700 (Wed, 30 Jul 2008) | 2 lines

use the proper method for building version.h

........
r134475 | mmichelson | 2008-07-30 11:31:47 -0700 (Wed, 30 Jul 2008) | 4 lines

Fix a spot where a function could return without bringing
a channel out of autoservice.


........
r134480 | tilghman | 2008-07-30 12:03:44 -0700 (Wed, 30 Jul 2008) | 5 lines

launch_netscript sometimes returns -1, which fails to set AGISTATUS.  Map
failure to -1, so that AGISTATUS is always set.
(closes issue #13199)
 Reported by: smw1218

........
r134536 | tilghman | 2008-07-30 12:47:16 -0700 (Wed, 30 Jul 2008) | 4 lines

Only override sysconfdir and mandir when prefix=/usr
(closes issue #13093)
 Reported by: pabelanger

........
r134540 | russell | 2008-07-30 12:52:53 -0700 (Wed, 30 Jul 2008) | 4 lines

Fix a memory leak in func_curl.  Every thread that used this function leaked
an allocation the size of a pointer.
(reported by jmls in #asterisk-dev)

........
r134595 | russell | 2008-07-30 13:37:17 -0700 (Wed, 30 Jul 2008) | 6 lines

Reduce stack consumption by 12.5% of the max stack size to fix a crash when
compiled with LOW_MEMORY.

(closes issue #13154)
Reported by: edantie

........
r134649 | tilghman | 2008-07-30 14:38:50 -0700 (Wed, 30 Jul 2008) | 4 lines

Qwell pointed out, via IRC, that the previous fix only worked when explicitly
set.  When nothing is set, and the option is implied, it breaks, because
configure sets the prefix to 'NONE'.  Fixing.

........
r134652 | murf | 2008-07-30 15:02:07 -0700 (Wed, 30 Jul 2008) | 19 lines

(closes issue #13197)
Reported by: pj

(closes issue #13051)
Reported by: pj

This patch substitutes commas in the expr 
supplied to the if () statement, as in
if ( expr ) ...

This solves both the bugs above, and makes
the source symmetric with switch statements,
which were earlier reported to need this sort
of treatment.

I tested this using the examples, both for
the compiler and at run time. Looks good.


........
r134704 | tilghman | 2008-07-30 15:39:57 -0700 (Wed, 30 Jul 2008) | 2 lines

Oops, wrong define

........
r134758 | mmichelson | 2008-07-31 08:56:18 -0700 (Thu, 31 Jul 2008) | 16 lines

Add more timeout checks into app_queue, specifically
targeting areas where an unknown and potentially
long time has just elapsed. Also added a check
to try_calling() to return early if the timeout
has elapsed instead of potentially setting a negative
timeout for the call (thus making it have *no* timeout
at all).


(closes issue #13186)
Reported by: miquel_cabrespina
Patches:
      13186.diff uploaded by putnopvut (license 60)
Tested by: miquel_cabrespina


........
r134814 | russell | 2008-07-31 09:45:31 -0700 (Thu, 31 Jul 2008) | 7 lines

In case we have some processing threads that free more frames than they allocate,
do not let the frame cache grow forever.

(closes issue #13160)
Reported by: tavius
Tested by: tavius, russell

........
r134883 | murf | 2008-07-31 12:23:42 -0700 (Thu, 31 Jul 2008) | 51 lines

(closes issue #11849)
Reported by: greyvoip
Tested by: murf

OK, a few days of debugging, a bunch of instrumentation
in chan_sip, main/channel.c, main/pbx.c, etc. and 5 solid 
notebook pages of notes later, I  have made the small
tweek necc. to get the start time right on the second 
CDR when:

  A Calls B
  B answ.
  A hits Xfer button on sip phone,
  A dials C and hits the OK button,
  A hangs up
  C answers ringing phone
  B and C converse
  B and/or C hangs up

But does not harm the scenario where:

  A Calls B
  B answ.
  B hits xfer button on sip phone,
  B dials C and hits the OK button,
  B hangs up
  C answers ringing phone
  A and C converse
  A and/or C hangs up

The difference in start times on the second CDR is because
of a Masquerade on the B channel when the xfer number is 
sent. It ends up replacing the CDR on the B channel with
a duplicate, which ends up getting tossed out. We keep 
a pointer to the first CDR, and update *that* after the
bridge closes. But, only if the CDR has changed.

I hope this change is specific enough not to muck
up any current CDR-based apps. In my defence, I 
assert that the previous information was wrong,
and this change fixes it, and possibly other
similar scenarios.

I wonder if I should be doing the same thing
for the channel, as I did for the peer, but
I can't think of a scenario this might affect.
I leave it, then, as an exersize for the users,
to find the scenario where the chan's CDR 
changes and loses the proper start time.


........
r134915 | russell | 2008-07-31 12:37:26 -0700 (Thu, 31 Jul 2008) | 9 lines

Get app_ices working again

(closes issue #12981)
Reported by: dlogan
Patches:
      20080709__app_ices_v2_update_trunk.diff uploaded by bbryant (license 36)
      20080709__app_ices_v2_update_14.diff uploaded by bbryant (license 36)
Tested by: bbryant

........
r134976 | tilghman | 2008-07-31 14:53:19 -0700 (Thu, 31 Jul 2008) | 9 lines

Specify codecs in callfiles and manager, to allow video calls to be set up
from callfiles and AMI.
(closes issue #9531)
 Reported by: Geisj
 Patches: 
       20080715__bug9531__1.4.diff.txt uploaded by Corydon76 (license 14)
       20080715__bug9531__1.6.0.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76

........
r134983 | kpfleming | 2008-07-31 15:18:11 -0700 (Thu, 31 Jul 2008) | 3 lines

accomodate users who seem to lack a sense of humor :-)


........
r135055 | mvanbaak | 2008-08-01 03:55:27 -0700 (Fri, 01 Aug 2008) | 8 lines

fix some potential deadlocks in chan_skinny

(closes issue #13215)
Reported by: qwell
Patches:
      2008080100_bug13215.diff.txt uploaded by mvanbaak (license 7)
Tested by: mvanbaak

........
r135058 | mvanbaak | 2008-08-01 04:43:46 -0700 (Fri, 01 Aug 2008) | 2 lines

make app_ices compile on OpenBSD.

........
r135473 | russell | 2008-08-04 09:26:17 -0700 (Mon, 04 Aug 2008) | 2 lines

Add a minor clarification to the documentation of mohinterpret and mohsuggest

........
r135479 | tilghman | 2008-08-04 09:56:19 -0700 (Mon, 04 Aug 2008) | 6 lines

Memory leak on unload
(closes issue #13231)
 Reported by: eliel
 Patches: 
       app_voicemail.leak.patch uploaded by eliel (license 64)

........
r135482 | tilghman | 2008-08-04 10:07:52 -0700 (Mon, 04 Aug 2008) | 2 lines

Define ASTSBINDIR for script

........
r135536 | russell | 2008-08-04 13:15:03 -0700 (Mon, 04 Aug 2008) | 2 lines

fix a config sample typo

........
r135597 | seanbright | 2008-08-05 06:25:00 -0700 (Tue, 05 Aug 2008) | 1 line

Use PATH_MAX for filenames
........
r135747 | tilghman | 2008-08-05 14:34:46 -0700 (Tue, 05 Aug 2008) | 9 lines

In a conversion to use ast_strlen_zero, the meaning of the flag IAX_HASCALLERID
was perverted.  This change reverts IAX2 to the original meaning, which was,
that the callerid set on the client should be overridden on the server, even if
that means the resulting callerid is blank.  In other words, if you set
"callerid=" in the IAX config, then the callerid should be overridden to blank,
even if set on the client.  Note that there's a distinction, even on realtime,
between the field not existing (NULL in databases) and the field existing, but
set to blank (override callerid to blank).

........
r135799 | murf | 2008-08-05 16:13:20 -0700 (Tue, 05 Aug 2008) | 34 lines

(closes issue #12982)
Reported by: bcnit
Tested by: murf

I discovered that also, in the previous bug fixes and changes,
the cdr.conf 'unanswered' option is not being obeyed, so
I fixed this.

And, yes, there are two 'answer' times involved in this
scenario, and I would agree with you, that the first 
answer time is the time that should appear in the CDR.
(the second 'answer' time is the time that the bridge
was begun).

I made the necessary adjustments, recording the first
answer time into the peer cdr, and then using that to
override the bridge cdr's value.

To get the 'unanswered' CDRs to appear, I purposely
output them, using the dial cmd to mark them as
DIALED (with a new flag), and outputting them if
they bear that flag, and you are in the right mode.

I also corrected one small mention of the Zap device
to equally consider the dahdi device.

I heavily tested 10-sec-wait macros in dial, and
without the macro call; I tested hangups while the
macro was running vs. letting the macro complete
and the bridge form. Looks OK. Removed all the
instrumentation and debug.



........
r135841 | mmichelson | 2008-08-05 17:25:10 -0700 (Tue, 05 Aug 2008) | 27 lines

Merging the issue11259 branch.

The purpose of this branch was to take into account
"burps" which could cause jitterbuffers to misbehave.
One such example is if the L option to Dial() were used
to inject audio into a bridged conversation at regular
intervals. Since the audio here was not passed through
the jitterbuffer, it would cause a gap in the jitterbuffer's
timestamps which would cause a frames to be dropped for a 
brief period.

Now ast_generic_bridge will empty and reset the jitterbuffer
each time it is called. This causes injected audio to be handled
properly.

ast_generic_bridge also will empty and reset the jitterbuffer
if it receives an AST_CONTROL_SRCUPDATE frame since the change
in audio source could negatively affect the jitterbuffer.

All of this was made possible by adding a new public API call
to the abstract_jb called ast_jb_empty_and_reset.

(closes issue #11259)
Reported by: plack
Tested by: putnopvut


........
r135847 | mmichelson | 2008-08-05 17:27:54 -0700 (Tue, 05 Aug 2008) | 4 lines

Revert inadvertent changes to app_skel that occurred when
I was testing for a memory leak


........
r135850 | mmichelson | 2008-08-05 17:29:54 -0700 (Tue, 05 Aug 2008) | 3 lines

Remove properties that should not be here


........
r135899 | tilghman | 2008-08-05 20:02:59 -0700 (Tue, 05 Aug 2008) | 4 lines

1) Bugfix for debugging code
2) Reduce compiler warnings for another section of debugging code
(Closes issue #13237)

........
r135915 | tilghman | 2008-08-05 20:24:56 -0700 (Tue, 05 Aug 2008) | 4 lines

Since powerof() can return an error condition, it's foolhardy not to detect and
deal with that condition.
(Related to issue #13240)

........
r135949 | tilghman | 2008-08-05 20:53:36 -0700 (Tue, 05 Aug 2008) | 4 lines

Fix a longstanding bug in channel walking logic, and fix the explanation to
make sense.
(Closes issue #13124)

........
r136062 | mmichelson | 2008-08-06 08:58:40 -0700 (Wed, 06 Aug 2008) | 16 lines

Since adding the AST_CONTROL_SRCUPDATE frame type,
there are places where ast_rtp_new_source may be called
where the tech_pvt of a channel may not yet have an
rtp structure allocated. This caused a crash in chan_skinny,
which was fixed earlier, but now the same crash has been 
reported against chan_h323 as well. It seems that the best 
solution is to modify ast_rtp_new_source to not attempt to 
set the marker bit if the rtp structure passed in is NULL.

This change to ast_rtp_new_source also allows the removal
of what is now a redundant pointer check from chan_skinny.

(closes issue #13247)
Reported by: pj


........

Modified:
    team/sruffell/asterisk-1.4-transcoder/   (props changed)
    team/sruffell/asterisk-1.4-transcoder/Makefile
    team/sruffell/asterisk-1.4-transcoder/apps/app_dahdibarge.c
    team/sruffell/asterisk-1.4-transcoder/apps/app_dahdiras.c
    team/sruffell/asterisk-1.4-transcoder/apps/app_dahdiscan.c
    team/sruffell/asterisk-1.4-transcoder/apps/app_dial.c
    team/sruffell/asterisk-1.4-transcoder/apps/app_flash.c
    team/sruffell/asterisk-1.4-transcoder/apps/app_ices.c
    team/sruffell/asterisk-1.4-transcoder/apps/app_meetme.c
    team/sruffell/asterisk-1.4-transcoder/apps/app_queue.c
    team/sruffell/asterisk-1.4-transcoder/apps/app_voicemail.c
    team/sruffell/asterisk-1.4-transcoder/channels/chan_dahdi.c
    team/sruffell/asterisk-1.4-transcoder/channels/chan_iax2.c
    team/sruffell/asterisk-1.4-transcoder/channels/chan_skinny.c
    team/sruffell/asterisk-1.4-transcoder/channels/iax2-parser.c
    team/sruffell/asterisk-1.4-transcoder/codecs/codec_dahdi.c
    team/sruffell/asterisk-1.4-transcoder/configs/chan_dahdi.conf.sample
    team/sruffell/asterisk-1.4-transcoder/configure
    team/sruffell/asterisk-1.4-transcoder/configure.ac
    team/sruffell/asterisk-1.4-transcoder/contrib/init.d/rc.mandrake.asterisk
    team/sruffell/asterisk-1.4-transcoder/funcs/func_curl.c
    team/sruffell/asterisk-1.4-transcoder/include/asterisk/abstract_jb.h
    team/sruffell/asterisk-1.4-transcoder/include/asterisk/cdr.h
    team/sruffell/asterisk-1.4-transcoder/include/asterisk/dahdi_compat.h
    team/sruffell/asterisk-1.4-transcoder/include/asterisk/sched.h
    team/sruffell/asterisk-1.4-transcoder/include/asterisk/threadstorage.h
    team/sruffell/asterisk-1.4-transcoder/include/asterisk/utils.h
    team/sruffell/asterisk-1.4-transcoder/main/abstract_jb.c
    team/sruffell/asterisk-1.4-transcoder/main/app.c
    team/sruffell/asterisk-1.4-transcoder/main/cdr.c
    team/sruffell/asterisk-1.4-transcoder/main/channel.c
    team/sruffell/asterisk-1.4-transcoder/main/cli.c
    team/sruffell/asterisk-1.4-transcoder/main/fixedjitterbuf.h
    team/sruffell/asterisk-1.4-transcoder/main/http.c
    team/sruffell/asterisk-1.4-transcoder/main/manager.c
    team/sruffell/asterisk-1.4-transcoder/main/rtp.c
    team/sruffell/asterisk-1.4-transcoder/main/sched.c
    team/sruffell/asterisk-1.4-transcoder/main/translate.c
    team/sruffell/asterisk-1.4-transcoder/pbx/pbx_ael.c
    team/sruffell/asterisk-1.4-transcoder/pbx/pbx_dundi.c
    team/sruffell/asterisk-1.4-transcoder/pbx/pbx_spool.c
    team/sruffell/asterisk-1.4-transcoder/res/res_agi.c
    team/sruffell/asterisk-1.4-transcoder/res/res_features.c
    team/sruffell/asterisk-1.4-transcoder/sample.call

Propchange: team/sruffell/asterisk-1.4-transcoder/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Aug  6 11:46:36 2008
@@ -1,1 +1,1 @@
-/branches/1.4:1-134244
+/branches/1.4:1-136068

Modified: team/sruffell/asterisk-1.4-transcoder/Makefile
URL: http://svn.digium.com/view/asterisk/team/sruffell/asterisk-1.4-transcoder/Makefile?view=diff&rev=136110&r1=136109&r2=136110
==============================================================================
--- team/sruffell/asterisk-1.4-transcoder/Makefile (original)
+++ team/sruffell/asterisk-1.4-transcoder/Makefile Wed Aug  6 11:46:36 2008
@@ -358,7 +358,7 @@
 	fi
 	@rm -f $@.tmp
 
-include/asterisk/version.h:
+include/asterisk/version.h: FORCE
 	@build_tools/make_version_h > $@.tmp
 	@if cmp -s $@.tmp $@ ; then : ; else \
 		mv $@.tmp $@ ; \
@@ -777,4 +777,6 @@
 	@cat sounds/sounds.xml >> $@
 	@echo "</menu>" >> $@
 
-.PHONY: menuselect main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) badshell menuselect.makeopts include/asterisk/version.h installdirs
+.PHONY: menuselect main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) badshell menuselect.makeopts installdirs
+
+FORCE:

Modified: team/sruffell/asterisk-1.4-transcoder/apps/app_dahdibarge.c
URL: http://svn.digium.com/view/asterisk/team/sruffell/asterisk-1.4-transcoder/apps/app_dahdibarge.c?view=diff&rev=136110&r1=136109&r2=136110
==============================================================================
--- team/sruffell/asterisk-1.4-transcoder/apps/app_dahdibarge.c (original)
+++ team/sruffell/asterisk-1.4-transcoder/apps/app_dahdibarge.c Wed Aug  6 11:46:36 2008
@@ -102,7 +102,7 @@
 static int conf_run(struct ast_channel *chan, int confno, int confflags)
 {
 	int fd;
-	DAHDI_CONFINFO ztc;
+	struct dahdi_confinfo ztc;
 	struct ast_frame *f;
 	struct ast_channel *c;
 	struct ast_frame fr;
@@ -114,8 +114,7 @@
 	int retryzap;
 	int origfd;
 	int ret = -1;
-
-	DAHDI_BUFFERINFO bi;
+	struct dahdi_bufferinfo bi;
 	char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
 	char *buf = __buf + AST_FRIENDLY_OFFSET;
 

Modified: team/sruffell/asterisk-1.4-transcoder/apps/app_dahdiras.c
URL: http://svn.digium.com/view/asterisk/team/sruffell/asterisk-1.4-transcoder/apps/app_dahdiras.c?view=diff&rev=136110&r1=136109&r2=136110
==============================================================================
--- team/sruffell/asterisk-1.4-transcoder/apps/app_dahdiras.c (original)
+++ team/sruffell/asterisk-1.4-transcoder/apps/app_dahdiras.c Wed Aug  6 11:46:36 2008
@@ -156,7 +156,7 @@
 	int status;
 	int res;
 	int signalled = 0;
-	DAHDI_BUFFERINFO savebi;
+	struct dahdi_bufferinfo savebi;
 	int x;
 	
 	res = ioctl(chan->fds[0], DAHDI_GET_BUFINFO, &savebi);
@@ -214,7 +214,7 @@
 	int res=-1;
 	char *args;
 	struct ast_module_user *u;
-	DAHDI_PARAMS ztp;
+	struct dahdi_params ztp;
 
 	if (!data) 
 		data = "";

Modified: team/sruffell/asterisk-1.4-transcoder/apps/app_dahdiscan.c
URL: http://svn.digium.com/view/asterisk/team/sruffell/asterisk-1.4-transcoder/apps/app_dahdiscan.c?view=diff&rev=136110&r1=136109&r2=136110
==============================================================================
--- team/sruffell/asterisk-1.4-transcoder/apps/app_dahdiscan.c (original)
+++ team/sruffell/asterisk-1.4-transcoder/apps/app_dahdiscan.c Wed Aug  6 11:46:36 2008
@@ -101,7 +101,7 @@
 static int conf_run(struct ast_channel *chan, int confno, int confflags)
 {
 	int fd;
-	DAHDI_CONFINFO ztc;
+	struct dahdi_confinfo ztc;
 	struct ast_frame *f;
 	struct ast_channel *c;
 	struct ast_frame fr;
@@ -115,8 +115,7 @@
 	int ret = -1;
 	char input[4];
 	int ic=0;
-	
-	DAHDI_BUFFERINFO bi;
+	struct dahdi_bufferinfo bi;
 	char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
 	char *buf = __buf + AST_FRIENDLY_OFFSET;
 	

Modified: team/sruffell/asterisk-1.4-transcoder/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/sruffell/asterisk-1.4-transcoder/apps/app_dial.c?view=diff&rev=136110&r1=136109&r2=136110
==============================================================================
--- team/sruffell/asterisk-1.4-transcoder/apps/app_dial.c (original)
+++ team/sruffell/asterisk-1.4-transcoder/apps/app_dial.c Wed Aug  6 11:46:36 2008
@@ -578,6 +578,10 @@
 						if (option_verbose > 2)
 							ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", c->name, in->name);
 						peer = c;
+						if (peer->cdr) {
+							peer->cdr->answer = ast_tvnow();
+							peer->cdr->disposition = AST_CDR_ANSWERED;
+						}
 						ast_copy_flags(peerflags, o,
 							       OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
 							       OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
@@ -1761,8 +1765,9 @@
 				res = -1;
 				goto done;
 			}
-			if (opermode && (!strncmp(chan->name,"Zap",3)) &&
-				(!strncmp(peer->name,"Zap",3)))
+			if (opermode && 
+				(((!strncasecmp(chan->name,"Zap",3)) && (!strncasecmp(peer->name,"Zap",3))) ||
+				 ((!strncasecmp(chan->name,"Dahdi",5)) && (!strncasecmp(peer->name,"Dahdi",5)))))
 			{
 				struct oprmode oprmode;
 

Modified: team/sruffell/asterisk-1.4-transcoder/apps/app_flash.c
URL: http://svn.digium.com/view/asterisk/team/sruffell/asterisk-1.4-transcoder/apps/app_flash.c?view=diff&rev=136110&r1=136109&r2=136110
==============================================================================
--- team/sruffell/asterisk-1.4-transcoder/apps/app_flash.c (original)
+++ team/sruffell/asterisk-1.4-transcoder/apps/app_flash.c Wed Aug  6 11:46:36 2008
@@ -84,7 +84,7 @@
 	int res = -1;
 	int x;
 	struct ast_module_user *u;
-	DAHDI_PARAMS ztp;
+	struct dahdi_params ztp;
 	u = ast_module_user_add(chan);
 	if (!strcasecmp(chan->tech->type, dahdi_chan_name)) {
 		memset(&ztp, 0, sizeof(ztp));

Modified: team/sruffell/asterisk-1.4-transcoder/apps/app_ices.c
URL: http://svn.digium.com/view/asterisk/team/sruffell/asterisk-1.4-transcoder/apps/app_ices.c?view=diff&rev=136110&r1=136109&r2=136110
==============================================================================
--- team/sruffell/asterisk-1.4-transcoder/apps/app_ices.c (original)
+++ team/sruffell/asterisk-1.4-transcoder/apps/app_ices.c Wed Aug  6 11:46:36 2008
@@ -48,8 +48,8 @@
 #include "asterisk/translate.h"
 #include "asterisk/options.h"
 
-#define ICES "/usr/bin/ices"
-#define LOCAL_ICES "/usr/local/bin/ices"
+#define path_BIN "/usr/bin/"
+#define path_LOCAL "/usr/local/bin/"
 
 static char *app = "ICES";
 
@@ -58,8 +58,7 @@
 static char *descrip = 
 "  ICES(config.xml) Streams to an icecast server using ices\n"
 "(available separately).  A configuration file must be supplied\n"
-"for ices (see examples/asterisk-ices.conf). \n";
-
+"for ices (see contrib/asterisk-ices.xml). \n";
 
 static int icesencode(char *filename, int fd)
 {
@@ -89,13 +88,24 @@
 		if ((x != STDIN_FILENO) && (x != STDOUT_FILENO))
 			close(x);
 	}
-	/* Most commonly installed in /usr/local/bin */
-	execl(ICES, "ices", filename, (char *)NULL);
-	/* But many places has it in /usr/bin */
-	execl(LOCAL_ICES, "ices", filename, (char *)NULL);
-	/* As a last-ditch effort, try to use PATH */
+
+	/* Most commonly installed in /usr/local/bin 
+	 * But many places has it in /usr/bin 
+	 * As a last-ditch effort, try to use PATH
+	 */
+	execl(path_LOCAL "ices2", "ices", filename, (char *)NULL);
+	execl(path_BIN "ices2", "ices", filename, (char *)NULL);
+	execlp("ices2", "ices", filename, (char *)NULL);
+
+	if (option_debug)
+		ast_log(LOG_DEBUG, "Couldn't find ices version 2, attempting to use ices version 1.");
+
+	execl(path_LOCAL "ices", "ices", filename, (char *)NULL);
+	execl(path_BIN "ices", "ices", filename, (char *)NULL);
 	execlp("ices", "ices", filename, (char *)NULL);
-	ast_log(LOG_WARNING, "Execute of ices failed\n");
+
+	ast_log(LOG_WARNING, "Execute of ices failed, could not be found.\n");
+	close(fd);
 	_exit(0);
 }
 
@@ -161,7 +171,6 @@
 	if (c)
 		*c = '\0';	
 	res = icesencode(filename, fds[0]);
-	close(fds[0]);
 	if (res >= 0) {
 		pid = res;
 		for (;;) {
@@ -192,6 +201,7 @@
 			ast_frfree(f);
 		}
 	}
+	close(fds[0]);
 	close(fds[1]);
 	
 	if (pid > -1)

Modified: team/sruffell/asterisk-1.4-transcoder/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/sruffell/asterisk-1.4-transcoder/apps/app_meetme.c?view=diff&rev=136110&r1=136109&r2=136110
==============================================================================
--- team/sruffell/asterisk-1.4-transcoder/apps/app_meetme.c (original)
+++ team/sruffell/asterisk-1.4-transcoder/apps/app_meetme.c Wed Aug  6 11:46:36 2008
@@ -742,7 +742,7 @@
 static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin, int make, int dynamic, int refcount)
 {
 	struct ast_conference *cnf;
-	DAHDI_CONFINFO ztc = { 0, };
+	struct dahdi_confinfo ztc = { 0, };
 	int confno_int = 0;
 
 	AST_LIST_LOCK(&confs);
@@ -1373,7 +1373,7 @@
 	struct ast_conf_user *user = NULL;
 	struct ast_conf_user *usr = NULL;
 	int fd;
-	DAHDI_CONFINFO ztc, ztc_empty;
+	struct dahdi_confinfo ztc, ztc_empty;
 	struct ast_frame *f;
 	struct ast_channel *c;
 	struct ast_frame fr;
@@ -1406,7 +1406,7 @@
 	char members[10] = "";
 	int dtmf, opt_waitmarked_timeout = 0;
 	time_t timeout = 0;
-	DAHDI_BUFFERINFO bi;
+	struct dahdi_bufferinfo bi;
 	char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
 	char *buf = __buf + AST_FRIENDLY_OFFSET;
 	int setusercount = 0;

Modified: team/sruffell/asterisk-1.4-transcoder/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/sruffell/asterisk-1.4-transcoder/apps/app_queue.c?view=diff&rev=136110&r1=136109&r2=136110
==============================================================================
--- team/sruffell/asterisk-1.4-transcoder/apps/app_queue.c (original)
+++ team/sruffell/asterisk-1.4-transcoder/apps/app_queue.c Wed Aug  6 11:46:36 2008
@@ -2452,17 +2452,35 @@
 			(res = say_position(qe)))
 			break;
 
+		/* If we have timed out, break out */
+		if (qe->expire && (time(NULL) > qe->expire)) {
+			*reason = QUEUE_TIMEOUT;
+			break;
+		}
+
 		/* Make a periodic announcement, if enabled */
 		if (qe->parent->periodicannouncefrequency && !ringing &&
 			(res = say_periodic_announcement(qe)))
 			break;
 
+		/* If we have timed out, break out */
+		if (qe->expire && (time(NULL) > qe->expire)) {
+			*reason = QUEUE_TIMEOUT;
+			break;
+		}
+		
 		/* Wait a second before checking again */
 		if ((res = ast_waitfordigit(qe->chan, RECHECK * 1000))) {
 			if (res > 0 && !valid_exit(qe, res))
 				res = 0;
 			else
 				break;
+		}
+		
+		/* If we have timed out, break out */
+		if (qe->expire && (time(NULL) > qe->expire)) {
+			*reason = QUEUE_TIMEOUT;
+			break;
 		}
 	}
 
@@ -2700,6 +2718,15 @@
 
 	memset(&bridge_config, 0, sizeof(bridge_config));
 	time(&now);
+
+	/* If we've already exceeded our timeout, then just stop
+	 * This should be extremely rare. queue_exec will take care
+	 * of removing the caller and reporting the timeout as the reason.
+	 */
+	if (qe->expire && now > qe->expire) {
+		res = 0;
+		goto out;
+	}
 		
 	for (; options && *options; options++)
 		switch (*options) {
@@ -3929,11 +3956,27 @@
 			}
 			makeannouncement = 1;
 
+			/* Leave if we have exceeded our queuetimeout */
+			if (qe.expire && (time(NULL) > qe.expire)) {
+				record_abandoned(&qe);
+				reason = QUEUE_TIMEOUT;
+				res = 0;
+				ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
+				break;
+			}
 			/* Make a periodic announcement, if enabled */
 			if (qe.parent->periodicannouncefrequency && !ringing)
 				if ((res = say_periodic_announcement(&qe)))
 					goto stop;
 
+			/* Leave if we have exceeded our queuetimeout */
+			if (qe.expire && (time(NULL) > qe.expire)) {
+				record_abandoned(&qe);
+				reason = QUEUE_TIMEOUT;
+				res = 0;
+				ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
+				break;
+			}
 			/* Try calling all queue members for 'timeout' seconds */
 			res = try_calling(&qe, args.options, args.announceoverride, args.url, &tries, &noption, args.agi);
 			if (res)
@@ -3986,7 +4029,6 @@
 			res = wait_a_bit(&qe);
 			if (res)
 				goto stop;
-
 
 			/* Since this is a priority queue and
 			 * it is not sure that we are still at the head

Modified: team/sruffell/asterisk-1.4-transcoder/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/sruffell/asterisk-1.4-transcoder/apps/app_voicemail.c?view=diff&rev=136110&r1=136109&r2=136110
==============================================================================
--- team/sruffell/asterisk-1.4-transcoder/apps/app_voicemail.c (original)
+++ team/sruffell/asterisk-1.4-transcoder/apps/app_voicemail.c Wed Aug  6 11:46:36 2008
@@ -7844,10 +7844,28 @@
 	voicemail_show_zones_help, NULL, &cli_show_voicemail_zones_deprecated },
 };
 
-static int load_config(void)
+static void free_vm_users(void)
 {
 	struct ast_vm_user *cur;
 	struct vm_zone *zcur;
+
+	AST_LIST_LOCK(&users);
+	while ((cur = AST_LIST_REMOVE_HEAD(&users, list))) {
+		ast_set_flag(cur, VM_ALLOCED);
+		free_user(cur);
+	}
+	AST_LIST_UNLOCK(&users);
+
+	AST_LIST_LOCK(&zones);
+	while ((zcur = AST_LIST_REMOVE_HEAD(&zones, list))) {
+		free_zone(zcur);
+	}
+	AST_LIST_UNLOCK(&zones);
+}
+
+static int load_config(void)
+{
+	struct ast_vm_user *cur;
 	struct ast_config *cfg, *ucfg;
 	char *cat;
 	struct ast_variable *var;
@@ -7897,16 +7915,9 @@
 
 	cfg = ast_config_load(VOICEMAIL_CONFIG);
 
+	free_vm_users();
+
 	AST_LIST_LOCK(&users);
-	while ((cur = AST_LIST_REMOVE_HEAD(&users, list))) {
-		ast_set_flag(cur, VM_ALLOCED);
-		free_user(cur);
-	}
-
-	AST_LIST_LOCK(&zones);
-	while ((zcur = AST_LIST_REMOVE_HEAD(&zones, list))) 
-		free_zone(zcur);
-	AST_LIST_UNLOCK(&zones);
 
 	memset(ext_pass_cmd, 0, sizeof(ext_pass_cmd));
 

Modified: team/sruffell/asterisk-1.4-transcoder/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/team/sruffell/asterisk-1.4-transcoder/channels/chan_dahdi.c?view=diff&rev=136110&r1=136109&r2=136110
==============================================================================
--- team/sruffell/asterisk-1.4-transcoder/channels/chan_dahdi.c (original)
+++ team/sruffell/asterisk-1.4-transcoder/channels/chan_dahdi.c Wed Aug  6 11:46:36 2008
@@ -398,7 +398,7 @@
 	unsigned int needunhold:1;
 	unsigned int linear:1;
 	unsigned int inthreeway:1;
-	DAHDI_CONFINFO curconf;
+	struct dahdi_confinfo curconf;
 };
 
 #define CONF_USER_REAL		(1 << 0)
@@ -413,7 +413,7 @@
 		
 	struct dahdi_subchannel sub_unused;		/*!< Just a safety precaution */
 	struct dahdi_subchannel subs[3];			/*!< Sub-channels */
-	DAHDI_CONFINFO saveconf;			/*!< Saved conference info */
+	struct dahdi_confinfo saveconf;			/*!< Saved conference info */
 
 	struct dahdi_pvt *slaves[MAX_SLAVES];		/*!< Slave to us (follows our conferencing) */
 	struct dahdi_pvt *master;				/*!< Master to us (we follow their conferencing) */
@@ -543,7 +543,7 @@
 	struct timeval flashtime;			/*!< Last flash-hook time */
 	struct ast_dsp *dsp;
 	int cref;					/*!< Call reference number */
-	DAHDI_DIAL_OPERATION dop;
+	struct dahdi_dialoperation dop;
 	int whichwink;					/*!< SIG_FEATDMF_TA Which wink are we on? */
 	char finaldial[64];
 	char accountcode[AST_MAX_ACCOUNT_CODE];		/*!< Account code */
@@ -589,7 +589,7 @@
 #ifdef HAVE_PRI
 	struct dahdi_pri pri;
 #endif
-	DAHDI_PARAMS timing;
+	struct dahdi_params timing;
 
 	char smdi_port[SMDI_MAX_FILENAME_LEN];
 };
@@ -952,7 +952,7 @@
 
 static int alloc_sub(struct dahdi_pvt *p, int x)
 {
-	DAHDI_BUFFERINFO bi;
+	struct dahdi_bufferinfo bi;
 	int res;
 	if (p->subs[x].dfd < 0) {
 #ifdef HAVE_ZAPTEL
@@ -1063,7 +1063,7 @@
 
 	if (pvt->pulse || ioctl(pvt->subs[SUB_REAL].dfd, DAHDI_SENDTONE, &dtmf)) {
 		int res;
-		DAHDI_DIAL_OPERATION zo = {
+		struct dahdi_dialoperation zo = {
 			.op = DAHDI_DIAL_OP_APPEND,
 			.dialstr[0] = 'T',
 			.dialstr[1] = digit,
@@ -1251,7 +1251,7 @@
 {
 	/* If the conference already exists, and we're already in it
 	   don't bother doing anything */
-	DAHDI_CONFINFO zi;
+	struct dahdi_confinfo zi;
 	
 	memset(&zi, 0, sizeof(zi));
 	zi.chan = 0;
@@ -1298,7 +1298,7 @@
 
 static int conf_del(struct dahdi_pvt *p, struct dahdi_subchannel *c, int index)
 {
-	DAHDI_CONFINFO zi;
+	struct dahdi_confinfo zi;
 	if (/* Can't delete if there's no dfd */
 		(c->dfd < 0) ||
 		/* Don't delete from the conference if it's not our conference */
@@ -1364,7 +1364,7 @@
 
 static int reset_conf(struct dahdi_pvt *p)
 {
-	DAHDI_CONFINFO zi;
+	struct dahdi_confinfo zi;
 	memset(&zi, 0, sizeof(zi));
 	p->confno = -1;
 	memset(&p->subs[SUB_REAL].curconf, 0, sizeof(p->subs[SUB_REAL].curconf));
@@ -1497,7 +1497,7 @@
 	p->echocanon = 0;
 }
 
-static void fill_txgain(DAHDI_GAINS *g, float gain, int law)
+static void fill_txgain(struct dahdi_gains *g, float gain, int law)
 {
 	int j;
 	int k;
@@ -1531,7 +1531,7 @@
 	}
 }
 
-static void fill_rxgain(DAHDI_GAINS *g, float gain, int law)
+static void fill_rxgain(struct dahdi_gains *g, float gain, int law)
 {
 	int j;
 	int k;
@@ -1567,7 +1567,7 @@
 
 static int set_actual_txgain(int fd, int chan, float gain, int law)
 {
-	DAHDI_GAINS g;
+	struct dahdi_gains g;
 	int res;
 
 	memset(&g, 0, sizeof(g));
@@ -1586,7 +1586,7 @@
 
 static int set_actual_rxgain(int fd, int chan, float gain, int law)
 {
-	DAHDI_GAINS g;
+	struct dahdi_gains g;
 	int res;
 
 	memset(&g, 0, sizeof(g));
@@ -1668,7 +1668,7 @@
 
 static int save_conference(struct dahdi_pvt *p)
 {
-	DAHDI_CONFINFO c;
+	struct dahdi_confinfo c;
 	int res;
 	if (p->saveconf.confmode) {
 		ast_log(LOG_WARNING, "Can't save conference -- already in use\n");
@@ -2444,7 +2444,7 @@
 	struct dahdi_pvt *p = ast->tech_pvt;
 	struct dahdi_pvt *tmp = NULL;
 	struct dahdi_pvt *prev = NULL;
-	DAHDI_PARAMS par;
+	struct dahdi_params par;
 
 	if (option_debug)
 		ast_log(LOG_DEBUG, "dahdi_hangup(%s)\n", ast->name);
@@ -3572,7 +3572,7 @@
 
 static int check_for_conference(struct dahdi_pvt *p)
 {
-	DAHDI_CONFINFO ci;
+	struct dahdi_confinfo ci;
 	/* Fine if we already have a master, etc */
 	if (p->master || (p->confno > -1))
 		return 0;
@@ -3595,7 +3595,7 @@
 static int get_alarms(struct dahdi_pvt *p)
 {
 	int res;
-	DAHDI_SPANINFO zi;
+	struct dahdi_spaninfo zi;
 	memset(&zi, 0, sizeof(zi));
 	zi.spanno = p->span;
 	res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_SPANSTAT, &zi);
@@ -4194,7 +4194,7 @@
 			if (p->oprmode < 0) break;
 			if (p->oprmode > 1)
 			{
-				DAHDI_PARAMS par;
+				struct dahdi_params par;
 
 				if (ioctl(p->oprpeer->subs[SUB_REAL].dfd, DAHDI_GET_PARAMS, &par) != -1)
 				{
@@ -4691,7 +4691,7 @@
 	/* make sure it sends initial key state as first frame */
 	if ((p->radio || (p->oprmode < 0)) && (!p->firstradio))
 	{
-		DAHDI_PARAMS ps;
+		struct dahdi_params ps;
 
 		ps.channo = p->channel;
 		if (ioctl(p->subs[SUB_REAL].dfd, DAHDI_GET_PARAMS, &ps) < 0) {
@@ -5233,7 +5233,7 @@
 	int x,y;
 	int features;
 	char *b2 = NULL;
-	DAHDI_PARAMS ps;
+	struct dahdi_params ps;
 	char chanprefix[*dahdi_chan_name_len + 4];
 
 	if (i->subs[index].owner) {
@@ -7051,7 +7051,7 @@
 }
 
 #ifdef HAVE_PRI
-static int pri_resolve_span(int *span, int channel, int offset, DAHDI_SPANINFO *si)
+static int pri_resolve_span(int *span, int channel, int offset, struct dahdi_spaninfo *si)
 {
 	int x;
 	int trunkgroup;
@@ -7099,8 +7099,8 @@
 
 static int pri_create_trunkgroup(int trunkgroup, int *channels)
 {
-	DAHDI_SPANINFO si;
-	DAHDI_PARAMS p;
+	struct dahdi_spaninfo si;
+	struct dahdi_params p;
 	int fd;
 	int span;
 	int ospan=0;
@@ -7183,7 +7183,7 @@
 	struct dahdi_pvt *tmp = NULL, *tmp2,  *prev = NULL;
 	char fn[80];
 #if 1
-	DAHDI_BUFFERINFO bi;
+	struct dahdi_bufferinfo bi;
 #endif
 	int res;
 	int span=0;
@@ -7191,7 +7191,7 @@
 	int x;
 	struct dahdi_pvt **wlist;
 	struct dahdi_pvt **wend;
-	DAHDI_PARAMS p;
+	struct dahdi_params p;
 
 	wlist = &iflist;
 	wend = &ifend;
@@ -7287,7 +7287,7 @@
 					destroy_dahdi_pvt(&tmp);
 					return NULL;
 				} else {
-					DAHDI_SPANINFO si;
+					struct dahdi_spaninfo si;
 					si.spanno = 0;
 					if (ioctl(tmp->subs[SUB_REAL].dfd,DAHDI_SPANSTAT,&si) == -1) {
 						ast_log(LOG_ERROR, "Unable to get span status: %s\n", strerror(errno));
@@ -7664,7 +7664,7 @@
 static inline int available(struct dahdi_pvt *p, int channelmatch, ast_group_t groupmatch, int *busy, int *channelmatched, int *groupmatched)
 {
 	int res;
-	DAHDI_PARAMS par;
+	struct dahdi_params par;
 
 	/* First, check group matching */
 	if (groupmatch) {
@@ -7768,7 +7768,7 @@
 static struct dahdi_pvt *chandup(struct dahdi_pvt *src)
 {
 	struct dahdi_pvt *p;
-	DAHDI_BUFFERINFO bi;
+	struct dahdi_bufferinfo bi;
 	int res;
 	
 	if ((p = ast_malloc(sizeof(*p)))) {
@@ -8075,7 +8075,7 @@
 	int x;
 	int span = PRI_SPAN(channel);
 	int spanfd;
-	DAHDI_PARAMS param;
+	struct dahdi_params param;
 	int principle = -1;
 	int explicit = PRI_EXPLICIT(channel);
 	channel = PRI_CHANNEL(channel);
@@ -9506,9 +9506,9 @@
 static int start_pri(struct dahdi_pri *pri)
 {
 	int res, x;
-	DAHDI_PARAMS p;
-	DAHDI_BUFFERINFO bi;
-	DAHDI_SPANINFO si;
+	struct dahdi_params p;
+	struct dahdi_bufferinfo bi;
+	struct dahdi_spaninfo si;
 	int i;
 	
 	for (i = 0; i < NUM_DCHANS; i++) {
@@ -10027,8 +10027,8 @@
 {
 	int channel;
 	struct dahdi_pvt *tmp = NULL;
-	DAHDI_CONFINFO ci;
-	DAHDI_PARAMS ps;
+	struct dahdi_confinfo ci;
+	struct dahdi_params ps;
 	int x;
 	ast_mutex_t *lock;
 	struct dahdi_pvt *start;
@@ -10193,7 +10193,7 @@
 	char alarms[50];
 
 	int ctl;
-	DAHDI_SPANINFO s;
+	struct dahdi_spaninfo s;
 
 #ifdef HAVE_ZAPTEL
 	if ((ctl = open("/dev/zap/ctl", O_RDWR)) < 0) {
@@ -11385,7 +11385,7 @@
 				int toneduration;
 				int ctlfd;
 				int res;
-				DAHDI_DIAL_PARAMS dps;
+				struct dahdi_dialparams dps;
 
 #ifdef HAVE_ZAPTEL
 				ctlfd = open("/dev/zap/ctl", O_RDWR);

Modified: team/sruffell/asterisk-1.4-transcoder/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/sruffell/asterisk-1.4-transcoder/channels/chan_iax2.c?view=diff&rev=136110&r1=136109&r2=136110
==============================================================================
--- team/sruffell/asterisk-1.4-transcoder/channels/chan_iax2.c (original)
+++ team/sruffell/asterisk-1.4-transcoder/channels/chan_iax2.c Wed Aug  6 11:46:36 2008
@@ -9500,33 +9500,20 @@
 				if (!ast_strlen_zero(v->value)) {
 					char name2[80];
 					char num2[80];
-					ast_callerid_split(v->value, name2, 80, num2, 80);
+					ast_callerid_split(v->value, name2, sizeof(name2), num2, sizeof(num2));
 					ast_string_field_set(peer, cid_name, name2);
 					ast_string_field_set(peer, cid_num, num2);
-					ast_set_flag(peer, IAX_HASCALLERID);
 				} else {
-					ast_clear_flag(peer, IAX_HASCALLERID);
 					ast_string_field_set(peer, cid_name, "");
 					ast_string_field_set(peer, cid_num, "");
 				}
+				ast_set_flag(peer, IAX_HASCALLERID);
 			} else if (!strcasecmp(v->name, "fullname")) {
-				if (!ast_strlen_zero(v->value)) {
-					ast_string_field_set(peer, cid_name, v->value);
-					ast_set_flag(peer, IAX_HASCALLERID);
-				} else {
-					ast_string_field_set(peer, cid_name, "");
-					if (ast_strlen_zero(peer->cid_num))
-						ast_clear_flag(peer, IAX_HASCALLERID);
-				}
+				ast_string_field_set(peer, cid_name, S_OR(v->value, ""));
+				ast_set_flag(peer, IAX_HASCALLERID);
 			} else if (!strcasecmp(v->name, "cid_number")) {
-				if (!ast_strlen_zero(v->value)) {
-					ast_string_field_set(peer, cid_num, v->value);
-					ast_set_flag(peer, IAX_HASCALLERID);
-				} else {
-					ast_string_field_set(peer, cid_num, "");
-					if (ast_strlen_zero(peer->cid_name))
-						ast_clear_flag(peer, IAX_HASCALLERID);
-				}
+				ast_string_field_set(peer, cid_num, S_OR(v->value, ""));
+				ast_set_flag(peer, IAX_HASCALLERID);
 			} else if (!strcasecmp(v->name, "sendani")) {
 				ast_set2_flag(peer, ast_true(v->value), IAX_SENDANI);	
 			} else if (!strcasecmp(v->name, "inkeys")) {

Modified: team/sruffell/asterisk-1.4-transcoder/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/sruffell/asterisk-1.4-transcoder/channels/chan_skinny.c?view=diff&rev=136110&r1=136109&r2=136110
==============================================================================
--- team/sruffell/asterisk-1.4-transcoder/channels/chan_skinny.c (original)
+++ team/sruffell/asterisk-1.4-transcoder/channels/chan_skinny.c Wed Aug  6 11:46:36 2008
@@ -1476,6 +1476,7 @@
 
 	if (letohl(req->len > SKINNY_MAX_PACKET) || letohl(req->len < 0)) {
 		ast_log(LOG_WARNING, "transmit_response: the length of the request is out of bounds\n");
+		ast_mutex_unlock(&s->lock);
 		return -1;
 	}
 
@@ -2867,9 +2868,7 @@
 	case AST_CONTROL_PROCEEDING:
 		break;
 	case AST_CONTROL_SRCUPDATE:
-		if (sub->rtp) {
-			ast_rtp_new_source(sub->rtp);
-		}
+		ast_rtp_new_source(sub->rtp);
 		break;
 	default:
 		ast_log(LOG_WARNING, "Don't know how to indicate condition %d\n", ind);
@@ -4819,6 +4818,7 @@
 		if(setsockopt(skinnysock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) {
 			ast_log(LOG_ERROR, "Set Socket Options failed: errno %d, %s\n", errno, strerror(errno));
 			ast_config_destroy(cfg);
+			ast_mutex_unlock(&netlock);
 			return 0;
 		}
 		if (skinnysock < 0) {
@@ -4831,6 +4831,7 @@
 				close(skinnysock);
 				skinnysock = -1;
 				ast_config_destroy(cfg);
+				ast_mutex_unlock(&netlock);
 				return 0;

[... 1212 lines stripped ...]



More information about the svn-commits mailing list