[asterisk-commits] qwell: branch 10-digiumphones r378659 - in /branches/10-digiumphones: ./ addo...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 8 13:09:21 CST 2013


Author: qwell
Date: Tue Jan  8 13:09:11 2013
New Revision: 378659

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=378659
Log:
Multiple revisions 377136,377166,377212,377227,377241,377258,377261,377354,377382,377399,377432,377504,377510,377558,377592,377624,377656,377705,377709,377741,377772

........
  r377136 | rmudgett | 2012-12-03 14:33:08 -0600 (Mon, 03 Dec 2012) | 17 lines
  
  Cleanup core main on exit.
  
  * Cleanup time zones on exit.
  
  * Make exit clean/unclean report consistent for AMI and CLI in
  really_quit().
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        core-cleanup-1_8-10.patch (license #5909) patch uploaded by Corey Farrell
        core-cleanup-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377135 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r377166 | rmudgett | 2012-12-03 16:53:58 -0600 (Mon, 03 Dec 2012) | 15 lines
  
  Cleanup ast_run_atexits() atexits list.
  
  * Convert atexits list to a mutex instead of a rd/wr lock.  The lock is
  only write locked.
  
  * Move CLI verbose Asterisk ending message to where AMI message is output
  in really_quit() to avoid further surprises about using stuff already
  shutdown.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  ........
  
  Merged revisions 377165 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r377212 | rmudgett | 2012-12-04 16:31:02 -0600 (Tue, 04 Dec 2012) | 1 line
  
  confbridge: Update online XML documentation.
........
  r377227 | rmudgett | 2012-12-04 18:49:53 -0600 (Tue, 04 Dec 2012) | 29 lines
  
  confbridge: Fix several small issues.
  
  * Made func_confbridge_helper() allow an empty value when setting options.
  You previously could not Set(CONFBRIDGE(user,pin)=) and clear the
  configured pin from the dialplan.
  
  * Made func_confbridge_helper() handle its datastore better if multiple
  threads attempt to set the first CONFBRIDGE option value on the channel.
  
  * Made the func_confbridge_helper() only output one diagnostic message
  concerning the option.
  
  * Made the bridge video_mode able to repeatedly change in the config file
  and CONFBRIDGE dialplan function.  The video_mode option values are an
  enum and not independent of each other.
  
  * Made handle_cli_confbridge_show_bridge_profile() better handle the
  video_mode option.
  
  * Simplified datastore handling code in conf_find_user_profile() and
  conf_find_bridge_profile().
  
  * Made parse_bridge(), parse_user(), and parse_menu() use var->file
  instead of CONFBRIDGE_CONFIG because the var could have been from an
  include file.
  
  (closes issue ASTERISK-20655)
  Reported by: Birger "WIMPy" Harzenetter
........
  r377241 | rmudgett | 2012-12-04 20:09:13 -0600 (Tue, 04 Dec 2012) | 4 lines
  
  * Fix registering core show codecs/codec CLI commands twice.
  
  * Fix registering atexit format_attr_shutdown() more than once.
........
  r377258 | file | 2012-12-05 10:49:33 -0600 (Wed, 05 Dec 2012) | 19 lines
  
  Fix a SIP request memory leak with TLS connections.
  
  During the TLS re-work in chan_sip some TLS specific code was moved
  into a separate function. This function operates on a copy of the
  incoming SIP request. This copy was never deinitialized causing a
  memory leak for each request processed.
  
  This function is now given a SIP request structure which it can use
  to copy the incoming request into. This reduces the amount of memory
  allocations done since the internal allocated components are reused
  between packets and also ensures the SIP request structure is
  deinitialized when the TLS connection is torn down.
  
  (closes issue ASTERISK-20763)
  Reported by: deti
  ........
  
  Merged revisions 377257 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r377261 | jrose | 2012-12-05 10:57:26 -0600 (Wed, 05 Dec 2012) | 15 lines
  
  res_srtp: Fix a crash caused by srtp_dealloc on an already dealloced session
  
  When srtp_create fails, the session may be dealloced or just not alloced. At
  the same time though, the session pointer might not be set to NULL in this
  process and attempting to srtp_dealloc it again will cause a segfault. This
  patch checks for failure of srtp_create and sets the session pointer to NULL
  if it fails.
  
  (closes issue ASTERISK-20499)
  Reported by: tootai
  Review: https://reviewboard.asterisk.org/r/2228/
  ........
  
  Merged revisions 377256 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r377354 | rmudgett | 2012-12-06 17:56:45 -0600 (Thu, 06 Dec 2012) | 24 lines
  
  confbridge: Fix some resource leaks on conference teardown.
  
  * Made destroy_conference_bridge() destroy a missed ast_mutex_t and ast_cond_t.
  
  * Made join_conference_bridge() init the ast_mutex_t's and ast_cond_t so
  destroy_conference_bridge() can destroy them unconditionally.
  
  * Made join_conference_bridge() abort if the new conference could not be
  added to the conferences container.
  
  * Made leave_conference() discard any post-join actions if
  join_conference_bridge() had to abort early.
  
  * Made the join_conference_bridge() diagnostic messages better describe
  what happened.
  
  * Renamed leave_conference_bridge() to leave_conference() and made it only
  take a conference user pointer.  The conference pointer was redundant.
  
  * Made conf_bridge_profile_copy() use struct copy instead of memcpy().
  
  * No need to lock the conference in start_conf_record_thread() since all
  of the callers already have it locked.
........
  r377382 | kmoore | 2012-12-07 15:58:21 -0600 (Fri, 07 Dec 2012) | 17 lines
  
  codec_dahdi: Fix output of "transcoder show" CLI command.
  
  In r306010 "Asterisk media architecture conversion - no more format
  bitfields", the logic for incrementing encoders and decoders when
  opening transcoder channels was changed without making the corresponding
  change when decrementing encoder / decoder channels.  The result being
  that when a channel was destroyed, codec_dahdi couldn't properly tell if
  it was an encoder or decoder, and the default case is to assume it was a
  decoder.
  
  This could result in negative numbers for decoders in use like in:
    VOIP6*CLI> transcoder show
    2/-2 encoders/decoders of 92 channels are in use.
  
  (closes issue ASTERISK-19921)
  Patch-by: Shaun Ruffell
........
  r377399 | rmudgett | 2012-12-07 17:42:03 -0600 (Fri, 07 Dec 2012) | 5 lines
  
  MALLOC_DEBUG: Only wait if we want atexit allocation dumps.
  ........
  
  Merged revisions 377398 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r377432 | rmudgett | 2012-12-07 18:29:23 -0600 (Fri, 07 Dec 2012) | 14 lines
  
  Fix order of SIP allow/disallow in MySQL contrib script.
  
  Using the contrib sippeers.sql script to create the sippeers MySQL table
  would result in being unable to place calls if you set the disallow value
  to all.
  
  (closes issue ASTERISK-20756)
  Reported by: Andre Luis
  Patches:
        sippeers.patch patch uploaded by Andre Luis
  ........
  
  Merged revisions 377431 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r377504 | tilghman | 2012-12-09 19:24:41 -0600 (Sun, 09 Dec 2012) | 5 lines
  
  Remove some dead code and additionally handle a case that wasn't handled.
  ........
  
  Merged revisions 377487 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r377510 | tilghman | 2012-12-09 19:39:58 -0600 (Sun, 09 Dec 2012) | 16 lines
  
  Improve documentation by making all of the colors used readable,
  no matter what the background color is.
  
  Dark blue on a black background is unreadable, as is yellow on a
  light background.  This patch turns on the bright attribute for
  colors when on a dark background and turns *off* the bright
  attribute when the -W command line option is used (indicating a
  _light_ background).  This ensures that text is readable in both
  cases.
  
  Patch by: tilghman
  Review: https://reviewboard.asterisk.org/r/2224
  ........
  
  Merged revisions 377509 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r377558 | igorg | 2012-12-09 23:04:36 -0600 (Sun, 09 Dec 2012) | 8 lines
  
  Fix crash on transfer initiated from insreeen menu on Unistim phones. Removed CDR-related code that moved to do_masquarade before.
  
  (closes issue ASTERISK-20417)
  Reported by: Rudolf Migalin
  ........
  
  Merged revisions 377557 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r377592 | igorg | 2012-12-10 00:41:47 -0600 (Mon, 10 Dec 2012) | 9 lines
  
  Fix codec mismatch
  
  Fix code to send in both rx and tx open stream messages correct codecs. Found that on phase 0/1 phones wrong codecs cause to no audio in some situations. 
  
  (issue ASTERISK-20183)
  ........
  
  Merged revisions 377591 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r377624 | kmoore | 2012-12-10 08:40:26 -0600 (Mon, 10 Dec 2012) | 14 lines
  
  Handle Session-Expires less than local Min-SE in 200 OK
  
  Ensure that a call is immediately torn down if a Session-Expires value
  received in a 200 OK is less than the local Min-SE. This also prevents
  Asterisk from allowing calls with Session-Expires below the
  RFC4028-mandated minimum (90s).
  
  (closes issue ASTERISK-20653)
  Review: https://reviewboard.asterisk.org/r/2237/
  Patch-by: Kinsey Moore
  ........
  
  Merged revisions 377623 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r377656 | kmoore | 2012-12-10 10:53:16 -0600 (Mon, 10 Dec 2012) | 14 lines
  
  Ensure ReceiveFax provides a CED tone via T.38
  
  When using res_fax_digium, the T.38 CED tone was not being provided
  properly which would cause some incoming faxes to fail. This was not an
  issue with res_fax_spandsp since it does not strictly honor the
  send_ced flag and sends the CED tone whenever receiving a T.38 fax.
  
  (closes issue FAX-343)
  Reported-by: Benjamin Tietz
  Patch-by: Kinsey Moore
  ........
  
  Merged revisions 377655 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r377705 | rmudgett | 2012-12-10 18:32:40 -0600 (Mon, 10 Dec 2012) | 14 lines
  
  Cleanup dnsmgr on exit.
  
  * Cleanup dnsmgr thread and CLI commands on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        dnsmgr-cleanup-1_8.patch (license #5909) patch uploaded by Corey Farrell
        dnsmgr-cleanup-10-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377704 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r377709 | rmudgett | 2012-12-10 19:00:05 -0600 (Mon, 10 Dec 2012) | 15 lines
  
  Cleanup event on exit.
  
  * Cleanup CLI commands on exit.
  
  * v10 only: Merged v1.8 -r374177 change to event.c missed in v10 -r374178.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        event_shutdown-10-only.patch (license #5909) patch uploaded by Corey Farrell
        event_shutdown-1_8-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
  ........
  
  Merged revisions 377708 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r377741 | rmudgett | 2012-12-10 20:11:29 -0600 (Mon, 10 Dec 2012) | 19 lines
  
  Cleanup indications on exit.
  
  * Made ast_unregister_indication_country() unlink the found tone zone
  before selecting a new default_tone_zone to make it impossible to select
  the tone zone being unregistered again.
  
  * Ringcadence is no longer parsed twice in store_config_tone_zone().
  
  * Cleanup CLI commands and destroy default_tone_zone on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        indications-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377740 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r377772 | rmudgett | 2012-12-10 20:42:34 -0600 (Mon, 10 Dec 2012) | 13 lines
  
  Cleanup logger on exit.
  
  * Cleanup CLI commands, destroy verbosers and logchannels lists on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        logger-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377771 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377136,377166,377212,377227,377241,377258,377261,377354,377382,377399,377432,377504,377510,377558,377592,377624,377656,377705,377709,377741,377772 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    branches/10-digiumphones/   (props changed)
    branches/10-digiumphones/addons/cdr_mysql.c
    branches/10-digiumphones/apps/app_confbridge.c
    branches/10-digiumphones/apps/confbridge/conf_config_parser.c
    branches/10-digiumphones/channels/chan_sip.c
    branches/10-digiumphones/channels/chan_unistim.c
    branches/10-digiumphones/codecs/codec_dahdi.c
    branches/10-digiumphones/contrib/realtime/mysql/sippeers.sql
    branches/10-digiumphones/include/asterisk/_private.h
    branches/10-digiumphones/main/asterisk.c
    branches/10-digiumphones/main/astmm.c
    branches/10-digiumphones/main/dnsmgr.c
    branches/10-digiumphones/main/event.c
    branches/10-digiumphones/main/format.c
    branches/10-digiumphones/main/indications.c
    branches/10-digiumphones/main/logger.c
    branches/10-digiumphones/main/stdtime/localtime.c
    branches/10-digiumphones/main/xmldoc.c
    branches/10-digiumphones/res/res_fax.c
    branches/10-digiumphones/res/res_srtp.c

Propchange: branches/10-digiumphones/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Propchange: branches/10-digiumphones/
------------------------------------------------------------------------------
--- branch-10-merged (original)
+++ branch-10-merged Tue Jan  8 13:09:11 2013
@@ -1,1 +1,1 @@
-/branches/10:1-377102,377105
+/branches/10:1-377806

Modified: branches/10-digiumphones/addons/cdr_mysql.c
URL: http://svnview.digium.com/svn/asterisk/branches/10-digiumphones/addons/cdr_mysql.c?view=diff&rev=378659&r1=378658&r2=378659
==============================================================================
--- branches/10-digiumphones/addons/cdr_mysql.c (original)
+++ branches/10-digiumphones/addons/cdr_mysql.c Tue Jan  8 13:09:11 2013
@@ -430,6 +430,9 @@
 	int res;
 	struct ast_config *cfg;
 	struct ast_variable *var;
+	/* CONFIG_STATUS_FILEUNCHANGED is impossible when config_flags is always 0,
+	 * and it has to be zero, so a reload can be sent to tell the driver to
+	 * rescan the table layout. */
 	struct ast_flags config_flags = { 0 };
 	struct column *entry;
 	char *temp;
@@ -445,11 +448,13 @@
 	 * have changed, which is not detectable by config file change detection,
 	 * but should still cause the configuration to be re-parsed. */
 	cfg = ast_config_load(config, config_flags);
-	if (!cfg) {
+	if (cfg == CONFIG_STATUS_FILEMISSING) {
 		ast_log(LOG_WARNING, "Unable to load config for mysql CDR's: %s\n", config);
 		return AST_MODULE_LOAD_SUCCESS;
-	} else if (cfg == CONFIG_STATUS_FILEUNCHANGED)
-		return AST_MODULE_LOAD_SUCCESS;
+	} else if (cfg == CONFIG_STATUS_FILEINVALID) {
+		ast_log(LOG_ERROR, "Unable to load configuration file '%s'\n", config);
+		return AST_MODULE_LOAD_DECLINE;
+	}
 
 	if (reload) {
 		AST_RWLIST_WRLOCK(&columns);

Modified: branches/10-digiumphones/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/branches/10-digiumphones/apps/app_confbridge.c?view=diff&rev=378659&r1=378658&r2=378659
==============================================================================
--- branches/10-digiumphones/apps/app_confbridge.c (original)
+++ branches/10-digiumphones/apps/app_confbridge.c Tue Jan  8 13:09:11 2013
@@ -60,34 +60,48 @@
 #include "asterisk/test.h"
 
 /*** DOCUMENTATION
-    <application name="ConfBridge" language="en_US">
-            <synopsis>
-                    Conference bridge application.
-            </synopsis>
-            <syntax>
-                    <parameter name="confno">
-                            <para>The conference number</para>
-                    </parameter>
-                    <parameter name="bridge_profile">
-                            <para>The bridge profile name from confbridge.conf.  When left blank, a dynamically built bridge profile created by the CONFBRIDGE dialplan function is searched for on the channel and used.  If no dynamic profile is present, the 'default_bridge' profile found in confbridge.conf is used. </para>
-                            <para>It is important to note that while user profiles may be unique for each participant, mixing bridge profiles on a single conference is _NOT_ recommended and will produce undefined results.</para>
-                    </parameter>
-                    <parameter name="user_profile">
-                            <para>The user profile name from confbridge.conf.  When left blank, a dynamically built user profile created by the CONFBRIDGE dialplan function is searched for on the channel and used.  If no dynamic profile is present, the 'default_user' profile found in confbridge.conf is used.</para>
-                    </parameter>
-                    <parameter name="menu">
-                            <para>The name of the DTMF menu in confbridge.conf to be applied to this channel.  No menu is applied by default if this option is left blank.</para>
-                    </parameter>
-            </syntax>
-            <description>
-                    <para>Enters the user into a specified conference bridge. The user can exit the conference by hangup or DTMF menu option.</para>
-            </description>
-			<see-also>
-				<ref type="application">ConfBridge</ref>
-				<ref type="function">CONFBRIDGE</ref>
-				<ref type="function">CONFBRIDGE_INFO</ref>
-			</see-also>
-    </application>
+	<application name="ConfBridge" language="en_US">
+		<synopsis>
+			Conference bridge application.
+		</synopsis>
+		<syntax>
+			<parameter name="conference" required="true">
+				<para>Name of the conference bridge.  You are not limited to just
+				numbers.</para>
+			</parameter>
+			<parameter name="bridge_profile">
+				<para>The bridge profile name from confbridge.conf.  When left blank,
+				a dynamically built bridge profile created by the CONFBRIDGE dialplan
+				function is searched for on the channel and used.  If no dynamic
+				profile is present, the 'default_bridge' profile found in
+				confbridge.conf is used. </para>
+				<para>It is important to note that while user profiles may be unique
+				for each participant, mixing bridge profiles on a single conference
+				is _NOT_ recommended and will produce undefined results.</para>
+			</parameter>
+			<parameter name="user_profile">
+				<para>The user profile name from confbridge.conf.  When left blank,
+				a dynamically built user profile created by the CONFBRIDGE dialplan
+				function is searched for on the channel and used.  If no dynamic
+				profile is present, the 'default_user' profile found in
+				confbridge.conf is used.</para>
+			</parameter>
+			<parameter name="menu">
+				<para>The name of the DTMF menu in confbridge.conf to be applied to
+				this channel.  No menu is applied by default if this option is left
+				blank.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Enters the user into a specified conference bridge.  The user can
+			exit the conference by hangup or DTMF menu option.</para>
+		</description>
+		<see-also>
+			<ref type="application">ConfBridge</ref>
+			<ref type="function">CONFBRIDGE</ref>
+			<ref type="function">CONFBRIDGE_INFO</ref>
+		</see-also>
+	</application>
 	<function name="CONFBRIDGE" language="en_US">
 		<synopsis>
 			Set a custom dynamic bridge and user profile on a channel for the ConfBridge application using the same options defined in confbridge.conf.
@@ -96,7 +110,7 @@
 			<parameter name="type" required="true">
 				<para>Type refers to which type of profile the option belongs too.  Type can be <literal>bridge</literal> or <literal>user</literal>.</para>
 			</parameter>
-            <parameter name="option" required="true">
+			<parameter name="option" required="true">
 				<para>Option refers to <filename>confbridge.conf</filename> option that is being set dynamically on this channel.</para>
 			</parameter>
 		</syntax>
@@ -282,7 +296,7 @@
 /*! \brief Container to hold all conference bridges in progress */
 static struct ao2_container *conference_bridges;
 
-static void leave_conference_bridge(struct conference_bridge *conference_bridge, struct conference_bridge_user *conference_bridge_user);
+static void leave_conference(struct conference_bridge_user *user);
 static int play_sound_number(struct conference_bridge *conference_bridge, int say_number);
 static int execute_menu_entry(struct conference_bridge *conference_bridge,
 	struct conference_bridge_user *conference_bridge_user,
@@ -546,9 +560,7 @@
 {
 	ao2_ref(conference_bridge, +1); /* give the record thread a ref */
 
-	ao2_lock(conference_bridge);
 	conf_start_record(conference_bridge);
-	ao2_unlock(conference_bridge);
 
 	if (ast_pthread_create_background(&conference_bridge->record_thread, NULL, record_thread, conference_bridge)) {
 		ast_log(LOG_WARNING, "Failed to create recording channel for conference %s\n", conference_bridge->name);
@@ -754,8 +766,6 @@
 
 	ast_debug(1, "Destroying conference bridge '%s'\n", conference_bridge->name);
 
-	ast_mutex_destroy(&conference_bridge->playback_lock);
-
 	if (conference_bridge->playback_chan) {
 		struct ast_channel *underlying_channel = conference_bridge->playback_chan->tech->bridged_channel(conference_bridge->playback_chan, NULL);
 		if (underlying_channel) {
@@ -770,7 +780,11 @@
 		ast_bridge_destroy(conference_bridge->bridge);
 		conference_bridge->bridge = NULL;
 	}
+
 	conf_bridge_profile_destroy(&conference_bridge->b_profile);
+	ast_cond_destroy(&conference_bridge->record_cond);
+	ast_mutex_destroy(&conference_bridge->record_lock);
+	ast_mutex_destroy(&conference_bridge->playback_lock);
 }
 
 /*! \brief Call the proper join event handler for the user for the conference bridge's current state
@@ -947,7 +961,7 @@
 	if (conference_bridge && (max_members_reached || conference_bridge->locked) && !ast_test_flag(&conference_bridge_user->u_profile, USER_OPT_ADMIN)) {
 		ao2_unlock(conference_bridges);
 		ao2_ref(conference_bridge, -1);
-		ast_debug(1, "Conference bridge '%s' is locked and caller is not an admin\n", name);
+		ast_debug(1, "Conference '%s' is locked and caller is not an admin\n", name);
 		ast_stream_and_wait(conference_bridge_user->chan,
 				conf_get_sound(CONF_SOUND_LOCKED, conference_bridge_user->b_profile.sounds),
 				"");
@@ -959,9 +973,16 @@
 		/* Try to allocate memory for a new conference bridge, if we fail... this won't end well. */
 		if (!(conference_bridge = ao2_alloc(sizeof(*conference_bridge), destroy_conference_bridge))) {
 			ao2_unlock(conference_bridges);
-			ast_log(LOG_ERROR, "Conference bridge '%s' does not exist.\n", name);
+			ast_log(LOG_ERROR, "Conference '%s' could not be created.\n", name);
 			return NULL;
 		}
+
+		/* Setup lock for playback channel */
+		ast_mutex_init(&conference_bridge->playback_lock);
+
+		/* Setup lock for the record channel */
+		ast_mutex_init(&conference_bridge->record_lock);
+		ast_cond_init(&conference_bridge->record_cond, NULL);
 
 		/* Setup conference bridge parameters */
 		conference_bridge->record_thread = AST_PTHREADT_NULL;
@@ -973,7 +994,7 @@
 			ao2_ref(conference_bridge, -1);
 			conference_bridge = NULL;
 			ao2_unlock(conference_bridges);
-			ast_log(LOG_ERROR, "Conference bridge '%s' could not be created.\n", name);
+			ast_log(LOG_ERROR, "Conference '%s' mixing bridge could not be created.\n", name);
 			return NULL;
 		}
 
@@ -986,15 +1007,15 @@
 			ast_bridge_set_talker_src_video_mode(conference_bridge->bridge);
 		}
 
-		/* Setup lock for playback channel */
-		ast_mutex_init(&conference_bridge->playback_lock);
-
-		/* Setup lock for the record channel */
-		ast_mutex_init(&conference_bridge->record_lock);
-		ast_cond_init(&conference_bridge->record_cond, NULL);
-
 		/* Link it into the conference bridges container */
-		ao2_link(conference_bridges, conference_bridge);
+		if (!ao2_link(conference_bridges, conference_bridge)) {
+			ao2_ref(conference_bridge, -1);
+			conference_bridge = NULL;
+			ao2_unlock(conference_bridges);
+			ast_log(LOG_ERROR,
+				"Conference '%s' could not be added to the conferences list.\n", name);
+			return NULL;
+		}
 
 		/* Set the initial state to EMPTY */
 		conference_bridge->state = CONF_STATE_EMPTY;
@@ -1007,7 +1028,7 @@
 		}
 
 		send_conf_start_event(conference_bridge->name);
-		ast_debug(1, "Created conference bridge '%s' and linked to container '%p'\n", name, conference_bridges);
+		ast_debug(1, "Created conference '%s' and linked to container.\n", name);
 	}
 
 	ao2_unlock(conference_bridges);
@@ -1026,7 +1047,7 @@
 
 	if (ast_check_hangup(conference_bridge_user->chan)) {
 		ao2_unlock(conference_bridge);
-		leave_conference_bridge(conference_bridge, conference_bridge_user);
+		leave_conference(conference_bridge_user);
 		return NULL;
 	}
 
@@ -1035,7 +1056,7 @@
 	/* Announce number of users if need be */
 	if (ast_test_flag(&conference_bridge_user->u_profile, USER_OPT_ANNOUNCEUSERCOUNT)) {
 		if (announce_user_count(conference_bridge, conference_bridge_user)) {
-			leave_conference_bridge(conference_bridge, conference_bridge_user);
+			leave_conference(conference_bridge_user);
 			return NULL;
 		}
 	}
@@ -1043,7 +1064,7 @@
 	if (ast_test_flag(&conference_bridge_user->u_profile, USER_OPT_ANNOUNCEUSERCOUNTALL) &&
 		(conference_bridge->activeusers > conference_bridge_user->u_profile.announce_user_count_all_after)) {
 		if (announce_user_count(conference_bridge, NULL)) {
-			leave_conference_bridge(conference_bridge, conference_bridge_user);
+			leave_conference(conference_bridge_user);
 			return NULL;
 		}
 	}
@@ -1058,21 +1079,26 @@
 }
 
 /*!
- * \brief Leave a conference bridge
+ * \brief Leave a conference
  *
- * \param conference_bridge The conference bridge to leave
- * \param conference_bridge_user The conference bridge user structure
- *
+ * \param user The conference user
  */
-static void leave_conference_bridge(struct conference_bridge *conference_bridge, struct conference_bridge_user *conference_bridge_user)
-{
-	ao2_lock(conference_bridge);
-
-	handle_conf_user_leave(conference_bridge_user);
-
-	/* Done mucking with the conference bridge, huzzah */
-	ao2_unlock(conference_bridge);
-	ao2_ref(conference_bridge, -1);
+static void leave_conference(struct conference_bridge_user *user)
+{
+	struct post_join_action *action;
+
+	ao2_lock(user->conference_bridge);
+	handle_conf_user_leave(user);
+	ao2_unlock(user->conference_bridge);
+
+	/* Discard any post-join actions */
+	while ((action = AST_LIST_REMOVE_HEAD(&user->post_join_list, list))) {
+		ast_free(action);
+	}
+
+	/* Done mucking with the conference, huzzah */
+	ao2_ref(user->conference_bridge, -1);
+	user->conference_bridge = NULL;
 }
 
 /*!
@@ -1455,7 +1481,7 @@
 
 	/* if we're shutting down, don't attempt to do further processing */
 	if (ast_shutting_down()) {
-		leave_conference_bridge(conference_bridge, &conference_bridge_user);
+		leave_conference(&conference_bridge_user);
 		conference_bridge = NULL;
 		goto confbridge_cleanup;
 	}
@@ -1481,7 +1507,7 @@
 	}
 
 	/* Easy as pie, depart this channel from the conference bridge */
-	leave_conference_bridge(conference_bridge, &conference_bridge_user);
+	leave_conference(&conference_bridge_user);
 	conference_bridge = NULL;
 
 	/* If the user was kicked from the conference play back the audio prompt for it */

Modified: branches/10-digiumphones/apps/confbridge/conf_config_parser.c
URL: http://svnview.digium.com/svn/asterisk/branches/10-digiumphones/apps/confbridge/conf_config_parser.c?view=diff&rev=378659&r1=378658&r2=378659
==============================================================================
--- branches/10-digiumphones/apps/confbridge/conf_config_parser.c (original)
+++ branches/10-digiumphones/apps/confbridge/conf_config_parser.c Tue Jan  8 13:09:11 2013
@@ -286,7 +286,6 @@
 		case 80:
 			break;
 		default:
-			ast_log(LOG_WARNING, "invalid mixing interval %u\n", b_profile->mix_interval);
 			b_profile->mix_interval = 0;
 			return -1;
 		}
@@ -294,11 +293,30 @@
 		ast_set2_flag(b_profile, ast_true(value), BRIDGE_OPT_RECORD_CONFERENCE);
 	} else if (!strcasecmp(name, "video_mode")) {
 		if (!strcasecmp(value, "first_marked")) {
-			ast_set_flag(b_profile, BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED);
+			ast_set_flags_to(b_profile,
+				BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED
+					| BRIDGE_OPT_VIDEO_SRC_LAST_MARKED
+					| BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER,
+				BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED);
 		} else if (!strcasecmp(value, "last_marked")) {
-			ast_set_flag(b_profile, BRIDGE_OPT_VIDEO_SRC_LAST_MARKED);
+			ast_set_flags_to(b_profile,
+				BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED
+					| BRIDGE_OPT_VIDEO_SRC_LAST_MARKED
+					| BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER,
+				BRIDGE_OPT_VIDEO_SRC_LAST_MARKED);
 		} else if (!strcasecmp(value, "follow_talker")) {
-			ast_set_flag(b_profile, BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER);
+			ast_set_flags_to(b_profile,
+				BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED
+					| BRIDGE_OPT_VIDEO_SRC_LAST_MARKED
+					| BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER,
+				BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER);
+		} else if (!strcasecmp(value, "none")) {
+			ast_clear_flag(b_profile,
+				BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED
+					| BRIDGE_OPT_VIDEO_SRC_LAST_MARKED
+					| BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER);
+		} else {
+			return -1;
 		}
 	} else if (!strcasecmp(name, "max_members")) {
 		if (sscanf(value, "%30u", &b_profile->max_members) != 1) {
@@ -346,7 +364,7 @@
 		ast_string_field_set(sounds, leave, tmp->sounds->leave);
 
 		ao2_ref(tmp->sounds, -1); /* sounds struct copied over to it from the template by reference only. */
-		ao2_ref(oldsounds,-1);    /* original sounds struct we don't need anymore */
+		ao2_ref(oldsounds, -1);    /* original sounds struct we don't need anymore */
 		tmp->sounds = sounds;     /* the new sounds struct that is a deep copy of the one from the template. */
 	} else {
 		return -1;
@@ -374,17 +392,16 @@
 };
 int func_confbridge_helper(struct ast_channel *chan, const char *cmd, char *data, const char *value)
 {
-	struct ast_datastore *datastore = NULL;
-	struct func_confbridge_data *b_data = NULL;
-	char *parse = NULL;
-	int new = 0;
+	struct ast_datastore *datastore;
+	struct func_confbridge_data *b_data;
+	char *parse;
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(type);
 		AST_APP_ARG(option);
 	);
 
 	/* parse all the required arguments and make sure they exist. */
-	if (ast_strlen_zero(data) || ast_strlen_zero(value)) {
+	if (ast_strlen_zero(data)) {
 		return -1;
 	}
 	parse = ast_strdupa(data);
@@ -394,50 +411,51 @@
 	}
 
 	ast_channel_lock(chan);
-	if (!(datastore = ast_channel_datastore_find(chan, &confbridge_datastore, NULL))) {
-		ast_channel_unlock(chan);
-
-		if (!(datastore = ast_datastore_alloc(&confbridge_datastore, NULL))) {
+	datastore = ast_channel_datastore_find(chan, &confbridge_datastore, NULL);
+	if (!datastore) {
+		datastore = ast_datastore_alloc(&confbridge_datastore, NULL);
+		if (!datastore) {
+			ast_channel_unlock(chan);
 			return 0;
 		}
-		if (!(b_data = ast_calloc(1, sizeof(*b_data)))) {
+		b_data = ast_calloc(1, sizeof(*b_data));
+		if (!b_data) {
+			ast_channel_unlock(chan);
 			ast_datastore_free(datastore);
 			return 0;
 		}
-		if (!(b_data->b_profile.sounds = bridge_profile_sounds_alloc())) {
+		b_data->b_profile.sounds = bridge_profile_sounds_alloc();
+		if (!b_data->b_profile.sounds) {
+			ast_channel_unlock(chan);
 			ast_datastore_free(datastore);
 			ast_free(b_data);
 			return 0;
 		}
 		datastore->data = b_data;
-		new = 1;
+		ast_channel_datastore_add(chan, datastore);
 	} else {
-		ast_channel_unlock(chan);
 		b_data = datastore->data;
 	}
+	ast_channel_unlock(chan);
 
 	/* SET(CONFBRIDGE(type,option)=value) */
-	if (!strcasecmp(args.type, "bridge") && !set_bridge_option(args.option, value, &b_data->b_profile)) {
-		b_data->b_usable = 1;
-	} else if (!strcasecmp(args.type, "user") && !set_user_option(args.option, value, &b_data->u_profile)) {
-		b_data->u_usable = 1;
-	} else {
-		ast_log(LOG_WARNING, "Profile type \"%s\" can not be set in CONFBRIDGE function with option \"%s\" and value \"%s\"\n",
-			args.type, args.option, value);
-		goto cleanup_error;
-	}
-	if (new) {
-		ast_channel_lock(chan);
-		ast_channel_datastore_add(chan, datastore);
-		ast_channel_unlock(chan);
-	}
-	return 0;
-
-cleanup_error:
-	ast_log(LOG_ERROR, "Invalid argument provided to the %s function\n", cmd);
-	if (new) {
-		ast_datastore_free(datastore);
-	}
+	if (!value) {
+		value = "";
+	}
+	if (!strcasecmp(args.type, "bridge")) {
+		if (!set_bridge_option(args.option, value, &b_data->b_profile)) {
+			b_data->b_usable = 1;
+			return 0;
+		}
+	} else if (!strcasecmp(args.type, "user")) {
+		if (!set_user_option(args.option, value, &b_data->u_profile)) {
+			b_data->u_usable = 1;
+			return 0;
+		}
+	}
+
+	ast_log(LOG_WARNING, "%s(%s,%s) cannot be set to '%s'. Invalid type, option, or value.\n",
+		cmd, args.type, args.option, value);
 	return -1;
 }
 
@@ -486,7 +504,7 @@
 			continue;
 		} else if (set_bridge_option(var->name, var->value, b_profile)) {
 			ast_log(LOG_WARNING, "Invalid: '%s' at line %d of %s is not supported.\n",
-				var->name, var->lineno, CONFBRIDGE_CONFIG);
+				var->name, var->lineno, var->file);
 		}
 	}
 	ao2_unlock(b_profile);
@@ -524,7 +542,7 @@
 			continue;
 		} else if (set_user_option(var->name, var->value, u_profile)) {
 			ast_log(LOG_WARNING, "Invalid option '%s' at line %d of %s is not supported.\n",
-				var->name, var->lineno, CONFBRIDGE_CONFIG);
+				var->name, var->lineno, var->file);
 		}
 	}
 	ao2_unlock(u_profile);
@@ -755,7 +773,7 @@
 			continue;
 		} else if (add_menu_entry(menu, var->name, var->value)) {
 			ast_log(LOG_WARNING, "Unknown option '%s' at line %d of %s is not supported.\n",
-				var->name, var->lineno, CONFBRIDGE_CONFIG);
+				var->name, var->lineno, var->file);
 		}
 	}
 	ao2_unlock(menu);
@@ -1009,14 +1027,25 @@
 		ast_cli(a->fd,"Max Members:          No Limit\n");
 	}
 
-	if (b_profile.flags & BRIDGE_OPT_VIDEO_SRC_LAST_MARKED) {
+	switch (b_profile.flags
+		& (BRIDGE_OPT_VIDEO_SRC_LAST_MARKED | BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED
+			| BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER)) {
+	case BRIDGE_OPT_VIDEO_SRC_LAST_MARKED:
 		ast_cli(a->fd, "Video Mode:           last_marked\n");
-	} else if (b_profile.flags & BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED) {
+		break;
+	case BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED:
 		ast_cli(a->fd, "Video Mode:           first_marked\n");
-	} else if (b_profile.flags & BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER) {
+		break;
+	case BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER:
 		ast_cli(a->fd, "Video Mode:           follow_talker\n");
-	} else {
+		break;
+	case 0:
 		ast_cli(a->fd, "Video Mode:           no video\n");
+		break;
+	default:
+		/* Opps.  We have more than one video mode flag set. */
+		ast_assert(0);
+		break;
 	}
 
 	ast_cli(a->fd,"sound_join:           %s\n", conf_get_sound(CONF_SOUND_JOIN, b_profile.sounds));
@@ -1229,7 +1258,7 @@
 	return 0;
 }
 
-void conf_destroy_config()
+void conf_destroy_config(void)
 {
 	if (user_profiles) {
 		ao2_ref(user_profiles, -1);
@@ -1316,15 +1345,14 @@
 
 	if (chan) {
 		ast_channel_lock(chan);
-		if ((datastore = ast_channel_datastore_find(chan, &confbridge_datastore, NULL))) {
-			ast_channel_unlock(chan);
+		datastore = ast_channel_datastore_find(chan, &confbridge_datastore, NULL);
+		ast_channel_unlock(chan);
+		if (datastore) {
 			b_data = datastore->data;
 			if (b_data->u_usable) {
 				conf_user_profile_copy(result, &b_data->u_profile);
 				return result;
 			}
-		} else {
-			ast_channel_unlock(chan);
 		}
 	}
 
@@ -1344,7 +1372,7 @@
 
 void conf_bridge_profile_copy(struct bridge_profile *dst, struct bridge_profile *src)
 {
-	memcpy(dst, src, sizeof(*dst));
+	*dst = *src;
 	if (src->sounds) {
 		ao2_ref(src->sounds, +1);
 	}
@@ -1367,15 +1395,14 @@
 
 	if (chan) {
 		ast_channel_lock(chan);
-		if ((datastore = ast_channel_datastore_find(chan, &confbridge_datastore, NULL))) {
-			ast_channel_unlock(chan);
+		datastore = ast_channel_datastore_find(chan, &confbridge_datastore, NULL);
+		ast_channel_unlock(chan);
+		if (datastore) {
 			b_data = datastore->data;
 			if (b_data->b_usable) {
 				conf_bridge_profile_copy(result, &b_data->b_profile);
 				return result;
 			}
-		} else {
-			ast_channel_unlock(chan);
 		}
 	}
 	if (ast_strlen_zero(bridge_profile_name)) {

Modified: branches/10-digiumphones/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/10-digiumphones/channels/chan_sip.c?view=diff&rev=378659&r1=378658&r2=378659
==============================================================================
--- branches/10-digiumphones/channels/chan_sip.c (original)
+++ branches/10-digiumphones/channels/chan_sip.c Tue Jan  8 13:09:11 2013
@@ -2561,10 +2561,10 @@
  * \retval -1 Failed to read data
  * \retval 0 Succeeded in reading data
  */
-static int sip_tls_read(struct sip_request *req, struct ast_tcptls_session_instance *tcptls_session, int authenticated, time_t start, struct sip_threadinfo *me)
+static int sip_tls_read(struct sip_request *req, struct sip_request *reqcpy, struct ast_tcptls_session_instance *tcptls_session,
+			int authenticated, time_t start, struct sip_threadinfo *me)
 {
 	int res, content_length, after_poll = 1, need_poll = 1;
-	struct sip_request reqcpy = { 0, };
 	char buf[1024] = "";
 	int timeout = -1;
 
@@ -2618,10 +2618,10 @@
 		}
 		ast_str_append(&req->data, 0, "%s", buf);
 	}
-	copy_request(&reqcpy, req);
-	parse_request(&reqcpy);
+	copy_request(reqcpy, req);
+	parse_request(reqcpy);
 	/* In order to know how much to read, we need the content-length header */
-	if (sscanf(sip_get_header(&reqcpy, "Content-Length"), "%30d", &content_length)) {
+	if (sscanf(sip_get_header(reqcpy, "Content-Length"), "%30d", &content_length)) {
 		while (content_length > 0) {
 			size_t bytes_read;
 			if (!tcptls_session->client && !authenticated) {
@@ -3035,7 +3035,7 @@
 			req.socket.fd = tcptls_session->fd;
 
 			if (tcptls_session->ssl) {
-				res = sip_tls_read(&req, tcptls_session, authenticated, start, me);
+				res = sip_tls_read(&req, &reqcpy, tcptls_session, authenticated, start, me);
 			} else {
 				res = sip_tcp_read(&req, tcptls_session, authenticated, start);
 			}
@@ -21560,6 +21560,9 @@
 				rtn = parse_session_expires(p_hdrval, &tmp_st_interval, &st_ref_param);
 				if (rtn != 0) {
 					ast_set_flag(&p->flags[0], SIP_PENDINGBYE);	
+				} else if (tmp_st_interval < st_get_se(p, FALSE)) {
+					ast_log(LOG_WARNING, "Got Session-Expires less than local Min-SE in 200 OK, tearing down call\n");
+					ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
 				}
 				if (st_ref_param == SESSION_TIMER_REFRESHER_PARAM_UAC) {
 				   p->stimer->st_ref = SESSION_TIMER_REFRESHER_US;

Modified: branches/10-digiumphones/channels/chan_unistim.c
URL: http://svnview.digium.com/svn/asterisk/branches/10-digiumphones/channels/chan_unistim.c?view=diff&rev=378659&r1=378658&r2=378659
==============================================================================
--- branches/10-digiumphones/channels/chan_unistim.c (original)
+++ branches/10-digiumphones/channels/chan_unistim.c Tue Jan  8 13:09:11 2013
@@ -1956,20 +1956,6 @@
 		   ast_quiet_chan(peerc);
 		   ast_quiet_chan(peerd); */
 
-		if (peera->cdr && peerb->cdr) {
-			peerb->cdr = ast_cdr_append(peerb->cdr, peera->cdr);
-		} else if (peera->cdr) {
-			peerb->cdr = peera->cdr;
-		}
-		peera->cdr = NULL;
-

[... 717 lines stripped ...]



More information about the asterisk-commits mailing list