[asterisk-commits] may: branch may/chan_ooh323_evo r378194 - in /team/may/chan_ooh323_evo: ./ ap...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Dec 21 15:35:46 CST 2012


Author: may
Date: Fri Dec 21 15:35:32 2012
New Revision: 378194

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=378194
Log:
Multiple revisions 377925,377966,377971-377975,377977,377981,377986,377994,378000-378002,378006,378011,378029,378039,378063-378064,378072,378074,378081,378091,378095,378122,378166

........
  r377925 | newtonr | 2012-12-13 02:43:40 +0400 (Thu, 13 Dec 2012) | 18 lines
  
  Incremented EXTRA_SOUNDS_VERSION in sounds/Makefile to 1.4.12 for new Extra Sounds releases
  
  See CHANGES-* files in English extra 1.4.12 tarballs for new sound prompts added.
  
  (closes ASTERISK-20328)
  Reported by: Matt Jordan
  (closes AST-755)
  Reported by: John Bigelow
  ........
  
  Merged revisions 377922 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377923 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377924 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r377966 | kmoore | 2012-12-13 18:28:57 +0400 (Thu, 13 Dec 2012) | 23 lines
  
  Ensure Min-SE is included in outbound INVITEs
  
  Asterisk now includes Min-SE in outbound INVITEs when the value is not
  90 (the default) and session timers are not disabled. This has the
  effect of Asterisk following RFC4028 more closely with regard to 422
  responses and preventing situations in which Asterisk would be forced
  to temporarily accept a call to tear it down based on a Session-Expires
  below the locally configured Min-SE.
  
  (issue SWP-5051)
  Review: https://reviewboard.asterisk.org/r/2222/
  Reported-by: Kinsey Moore
  Patch-by: Kinsey Moore
  ........
  
  Merged revisions 377946 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377947 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377948 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r377971 | beagles | 2012-12-13 19:22:27 +0400 (Thu, 13 Dec 2012) | 9 lines
  
  This change adds a SIP peer configuration feature to allow the peer's
  configured codecs to take precedence on an outgoing call.
  
  This change introduces a new peer configuration property named
  'ignore_requested_pref' that causes the requested codec to be ignored when
  determining the preferred codec for an outgoing call leg. The consequence is
  that Asterisk's usual efforts to prefer avoiding transcoding can be overridden
  on a peer-by-peer basis where appropriate. 
........
  r377972 | dlee | 2012-12-13 19:24:22 +0400 (Thu, 13 Dec 2012) | 5 lines
  
  Fixed configure.ac to look for proper uuid.h file
  
  Introduced in r377846, the configure script was looking for uuid.h instead
  of uuid/uuid.h.
........
  r377973 | mmichelson | 2012-12-13 19:37:45 +0400 (Thu, 13 Dec 2012) | 6 lines
  
  The UUID commit removed changes made in res_clialiases.c
  
  This puts back in the changes that are designed to work
  around a memory leak fix in the CLI code.
........
  r377974 | seanbright | 2012-12-13 19:37:55 +0400 (Thu, 13 Dec 2012) | 6 lines
  
  Use the UUID API to generate and validate UUIDs for res_calendar_exchange.
  
  Currently the res_calendar_exchange module uses its own method of generating
  UUIDs using ast_random().  Now that we have a UUID API we should use that
  instead.
........
  r377975 | mmichelson | 2012-12-13 19:40:03 +0400 (Thu, 13 Dec 2012) | 3 lines
  
  Re-add taskprocessor cleanup code that was removed by the UUID merge.
........
  r377977 | russell | 2012-12-13 20:18:52 +0400 (Thu, 13 Dec 2012) | 7 lines
  
  Remove compile time check HAVE_DEV_URANDOM.
  
  The code was doing a runtime check, anyway.  The compile time check isn't
  always valid (cross-compiling, packages).
  
  Review: https://reviewboard.asterisk.org/r/2245/
........
  r377981 | dlee | 2012-12-13 20:43:40 +0400 (Thu, 13 Dec 2012) | 1 line
  
  Bail configure if it can't find libuuid.
........
  r377986 | wedhorn | 2012-12-13 22:28:41 +0400 (Thu, 13 Dec 2012) | 14 lines
  
  Fix skinny debug tab completion
  
  Review the syntax of the 'skinny debug' command to show more than
  just 'show' for options to 'skinny debug' command.
  
  (closes issue ASTERISK-20789)
  Reported by: snuffy
  Tested by: snuffy, myself
  Patches:
      skinny-debug.diff uploaded by snuffy (license 5024)
  ........
  
  Merged revisions 377985 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r377994 | dlee | 2012-12-14 01:15:44 +0400 (Fri, 14 Dec 2012) | 1 line
  
  Fixed svn merge property breakage from r377986
........
  r378000 | seanbright | 2012-12-14 01:20:32 +0400 (Fri, 14 Dec 2012) | 8 lines
  
  Make generate_exchange_uuid() always return the passed ast_str pointer.
  
  I changed this code earlier to return NULL if it wasn't able to generate a UUID,
  whereas the earlier code would always return the ast_str that was passed in.
  Switch back to returning the ast_str, only set it to the empty string instead if
  UUID generation fails.  We still do a validity check later which will catch this
  and blow up if necessary.
........
  r378001 | wedhorn | 2012-12-14 01:25:31 +0400 (Fri, 14 Dec 2012) | 9 lines
  
  Minor fixes for chan_skinny
  
  Whitespace, change SUBSTATE_ONHOOK to correct SKINNY_ONHOOK and 
  correct len of 2 strcmp in skinny_setdebug(). (see opticron's review
  on https://reviewboard.asterisk.org/r/2240/)
  ........
  
  Merged revisions 377991 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r378002 | rmudgett | 2012-12-14 01:28:15 +0400 (Fri, 14 Dec 2012) | 35 lines
  
  confbridge: Fix MOH on simultaneous user entry to a new conference.
  
  When two users entered a new conference simultaneously, one of the callers
  hears MOH.  This happened if two unmarked users entered simultaneously and
  also if a waitmarked and a marked user entered simultaneously.
  
  * Created a confbridge internal MOH API to eliminate the inlined MOH
  handling code.  Note that the conference mixing bridge needs to be locked
  when actually starting/stopping MOH because there is a small window
  between the conference join unsuspend MOH and actually joining the mixing
  bridge.
  
  * Created the concept of suspended MOH so it can be interrupted while
  conference join announcements to the user and DTMF features can operate.
  
  * Suspend any MOH until the user is about to actually join the mixing
  bridge of the conference.  This way any pre-join file playback does not
  need to worry about MOH.
  
  * Made post-join actions only play deferred entry announcement files.
  Changing the user/conference state during that time is not protected or
  controlled by the state machine.
  
  (closes issue ASTERISK-20606)
  Reported by: Eugenia Belova
  Tested by: rmudgett
  
  Review: https://reviewboard.asterisk.org/r/2232/
  ........
  
  Merged revisions 377992 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377993 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r378006 | wedhorn | 2012-12-14 05:02:15 +0400 (Fri, 14 Dec 2012) | 8 lines
  
  Add g722 codec support to skinny
  
  (closes issue ASTERISK-20788)
  Reported by: snuffy
  Tested by: snuffy, myself
  Patches: 
      skinny-g722.diff uploaded by snuffy (license 5024)
........
  r378011 | wedhorn | 2012-12-14 05:55:43 +0400 (Fri, 14 Dec 2012) | 15 lines
  
  Fix skinny to recognise vmexten in general section of conf
  
  Fixup the vmexten so if globally set in general section will be honored by
  chan_skinny. Also get rid of the 'global_' part of variable name to match
  regexten.
  
  (closes issue ASTERISK-20790)
  Reported by: snuffy
  Tested by: snuffy, myself
  Patches: 
      skinny-vm.diff uploaded by snuffy (license 5024)
  ........
  
  Merged revisions 378010 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r378029 | rmudgett | 2012-12-15 00:22:36 +0400 (Sat, 15 Dec 2012) | 1 line
  
  app_queue: Make update_status() not return anything.
........
  r378039 | rmudgett | 2012-12-15 01:35:44 +0400 (Sat, 15 Dec 2012) | 26 lines
  
  app_queue: Revert bad ringinuse=no patch.
  
  With the option ringinuse=no set, the patch committed for ASTERISK-16115
  causes non-SIP queue members to never be called because the device state
  is checked after a channel is created to determine if the member is busy.
  These queue members always get the "Member %s is busy, cannot dial"
  message.
  
  Most channel drivers other than chan_sip use the default device state
  handling.  The default device-state state is considered in use or unknown
  if the channel exists or not respectively.
  
  (closes issue ASTERISK-20801)
  Reported by: rmudgett
  Patches:
        jira_asterisk_16115_revert_r370418_v1.8.patch (license #5621) patch uploaded by rmudgett
  ........
  
  Merged revisions 378036 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378037 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 378038 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r378063 | jrose | 2012-12-15 02:34:18 +0400 (Sat, 15 Dec 2012) | 8 lines
  
  Features: BRIDGE_FEATURES variable automixmonitor support and use proper party
  
  BRIDGE_FEATURES did not previously support the automixmonitor feature. Now it
  does. In addition, the BRIDGE_FEATURES variable would not apply features to
  the proper party based on whether the feature option letter was in caps or
  in lowercase (both ways would apply it to the caller). Now uppercase applies
  to the caller while lowercase applies to the callee (like with the dial option)
........
  r378064 | rmudgett | 2012-12-15 02:45:03 +0400 (Sat, 15 Dec 2012) | 4 lines
  
  chan_agent: Remove some duplicated code.
  
  No need to check for an agent twice.  Santa does that.
........
  r378072 | rmudgett | 2012-12-18 00:34:25 +0400 (Tue, 18 Dec 2012) | 9 lines
  
  chan_local: Misc lock and ref tweaks.
  
  * awesome_locking() does not need to thrash the pvt lock as much.
  
  * local_setoption() does not need to check for NULL pvt on cleanup since
  it will never be NULL.
  
  * Made ref the pvt before locking for consistency.
........
  r378074 | qwell | 2012-12-18 00:59:51 +0400 (Tue, 18 Dec 2012) | 10 lines
  
  Make libasteriskssl.so symlink use a relative path.
  
  This was causing issues when using DESTDIR, since the path to which the link
  pointed is not likely to exist (and not useful to exist) on the target system.
  
  (issue ASTNOW-284)
  ........
  
  Merged revisions 378073 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r378081 | rmudgett | 2012-12-18 01:22:21 +0400 (Tue, 18 Dec 2012) | 7 lines
  
  chan_local: Parse dial string consistently.
  
  * Fix local_alloc() unexpected limitation of exten and context length from
  a combined length of 80 characters to a normal 80 characters each.
  
  * Made local_alloc() and local_devicestate() parse the same way.
........
  r378091 | rmudgett | 2012-12-18 03:02:54 +0400 (Tue, 18 Dec 2012) | 22 lines
  
  Make chan_local module references tied to local_pvt lifetime.
  
  The chan_local module references were manually tied to the existence of
  the ;1 and ;2 channel links.
  
  * Made chan_local module references tied to the existence of the local_pvt
  structure as well as automatically take care of the module references.
  
  * Tweaked the wording of the local_fixup() failure warning message to make
  sense.
  
  Review: https://reviewboard.asterisk.org/r/2181/
  ........
  
  Merged revisions 378088 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378089 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 378090 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r378095 | rmudgett | 2012-12-18 03:10:42 +0400 (Tue, 18 Dec 2012) | 11 lines
  
  Fix potential double free when unloading a module.
  ........
  
  Merged revisions 378092 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378093 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 378094 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r378122 | kmoore | 2012-12-18 21:48:36 +0400 (Tue, 18 Dec 2012) | 17 lines
  
  Add test events for time limit-related hangups
  
  This patch adds hangup-related test events in order to support testing
  of time-limited bridges. This aids in testing the S() and L() bridge
  options.
  
  (issue SWP-4713)
  ........
  
  Merged revisions 378119 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378120 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 378121 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r378166 | rmudgett | 2012-12-21 01:51:03 +0400 (Fri, 21 Dec 2012) | 8 lines
  
  Give the causes[] a struct name.
  ........
  
  Merged revisions 378164 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378165 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 377925,377966,377971-377975,377977,377981,377986,377994,378000-378002,378006,378011,378029,378039,378063-378064,378072,378074,378081,378091,378095,378122,378166 from http://svn.asterisk.org/svn/asterisk/trunk

Modified:
    team/may/chan_ooh323_evo/   (props changed)
    team/may/chan_ooh323_evo/CHANGES
    team/may/chan_ooh323_evo/UPGRADE.txt
    team/may/chan_ooh323_evo/apps/app_confbridge.c
    team/may/chan_ooh323_evo/apps/app_queue.c
    team/may/chan_ooh323_evo/apps/confbridge/conf_state.c
    team/may/chan_ooh323_evo/apps/confbridge/conf_state_multi_marked.c
    team/may/chan_ooh323_evo/apps/confbridge/include/confbridge.h
    team/may/chan_ooh323_evo/channels/chan_agent.c
    team/may/chan_ooh323_evo/channels/chan_local.c
    team/may/chan_ooh323_evo/channels/chan_sip.c
    team/may/chan_ooh323_evo/channels/chan_skinny.c
    team/may/chan_ooh323_evo/channels/sip/include/sip.h
    team/may/chan_ooh323_evo/configs/sip.conf.sample
    team/may/chan_ooh323_evo/configure
    team/may/chan_ooh323_evo/configure.ac
    team/may/chan_ooh323_evo/include/asterisk/autoconfig.h.in
    team/may/chan_ooh323_evo/include/asterisk/bridging.h
    team/may/chan_ooh323_evo/main/Makefile
    team/may/chan_ooh323_evo/main/channel.c
    team/may/chan_ooh323_evo/main/features.c
    team/may/chan_ooh323_evo/main/loader.c
    team/may/chan_ooh323_evo/main/taskprocessor.c
    team/may/chan_ooh323_evo/main/utils.c
    team/may/chan_ooh323_evo/res/res_calendar_exchange.c
    team/may/chan_ooh323_evo/res/res_clialiases.c
    team/may/chan_ooh323_evo/sounds/Makefile

Propchange: team/may/chan_ooh323_evo/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/may/chan_ooh323_evo/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 21 15:35:32 2012
@@ -1,1 +1,1 @@
-/trunk:376341-376345,377841,377844-377915
+/trunk:376341-376345,377841,377844-377915,377925-378166

Propchange: team/may/chan_ooh323_evo/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Dec 21 15:35:32 2012
@@ -1,1 +1,1 @@
-/trunk:1-377812,377841,377844-377915
+/trunk:1-378193

Modified: team/may/chan_ooh323_evo/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_evo/CHANGES?view=diff&rev=378194&r1=378193&r2=378194
==============================================================================
--- team/may/chan_ooh323_evo/CHANGES (original)
+++ team/may/chan_ooh323_evo/CHANGES Fri Dec 21 15:35:32 2012
@@ -30,6 +30,16 @@
    than 15 characters and no longer shows authorization requirement for commands.
    'Manager Show Command' now displays the privileges needed for using a given
    manager command instead.
+
+Features
+-------------------
+ * The BRIDGE_FEATURES channel variable would previously only set features for
+   the calling party and would set this feature regardless of whether the
+   feature was in caps or in lowercase. Use of a caps feature for a letter
+   will now apply the feature to the calling party while use of a lowercase
+   letter will apply that feature to the called party.
+
+ * Add support for automixmonitor to the BRIDGE_FEATURES channel variable.
 
 Logging
 -------------------

Modified: team/may/chan_ooh323_evo/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_evo/UPGRADE.txt?view=diff&rev=378194&r1=378193&r2=378194
==============================================================================
--- team/may/chan_ooh323_evo/UPGRADE.txt (original)
+++ team/may/chan_ooh323_evo/UPGRADE.txt Fri Dec 21 15:35:32 2012
@@ -64,6 +64,9 @@
  - Asterisk has always had code to ignore dash '-' characters that are not
    part of a character set in the dialplan extensions.  The code now
    consistently ignores these characters when matching dialplan extensions.
+ - BRIDGE_FEATURES channel variable is now casesensitive for feature letter codes.
+   Uppercase variants apply them to the calling party while lowercase variants
+   apply them to the called party.
 
 From 10 to 11:
 

Modified: team/may/chan_ooh323_evo/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_evo/apps/app_confbridge.c?view=diff&rev=378194&r1=378193&r2=378194
==============================================================================
--- team/may/chan_ooh323_evo/apps/app_confbridge.c (original)
+++ team/may/chan_ooh323_evo/apps/app_confbridge.c Fri Dec 21 15:35:32 2012
@@ -909,6 +909,94 @@
 	return 0;
 }
 
+void conf_moh_stop(struct conference_bridge_user *user)
+{
+	user->playing_moh = 0;
+	if (!user->suspended_moh) {
+		int in_bridge;
+
+		/*
+		 * Locking the ast_bridge here is the only way to hold off the
+		 * call to ast_bridge_join() in confbridge_exec() from
+		 * interfering with the bridge and MOH operations here.
+		 */
+		ast_bridge_lock(user->conference_bridge->bridge);
+
+		/*
+		 * Temporarily suspend the user from the bridge so we have
+		 * control to stop MOH if needed.
+		 */
+		in_bridge = !ast_bridge_suspend(user->conference_bridge->bridge, user->chan);
+		ast_moh_stop(user->chan);
+		if (in_bridge) {
+			ast_bridge_unsuspend(user->conference_bridge->bridge, user->chan);
+		}
+
+		ast_bridge_unlock(user->conference_bridge->bridge);
+	}
+}
+
+void conf_moh_start(struct conference_bridge_user *user)
+{
+	user->playing_moh = 1;
+	if (!user->suspended_moh) {
+		int in_bridge;
+
+		/*
+		 * Locking the ast_bridge here is the only way to hold off the
+		 * call to ast_bridge_join() in confbridge_exec() from
+		 * interfering with the bridge and MOH operations here.
+		 */
+		ast_bridge_lock(user->conference_bridge->bridge);
+
+		/*
+		 * Temporarily suspend the user from the bridge so we have
+		 * control to start MOH if needed.
+		 */
+		in_bridge = !ast_bridge_suspend(user->conference_bridge->bridge, user->chan);
+		ast_moh_start(user->chan, user->u_profile.moh_class, NULL);
+		if (in_bridge) {
+			ast_bridge_unsuspend(user->conference_bridge->bridge, user->chan);
+		}
+
+		ast_bridge_unlock(user->conference_bridge->bridge);
+	}
+}
+
+/*!
+ * \internal
+ * \brief Unsuspend MOH for the conference user.
+ *
+ * \param user Conference user to unsuspend MOH on.
+ *
+ * \return Nothing
+ */
+static void conf_moh_unsuspend(struct conference_bridge_user *user)
+{
+	ao2_lock(user->conference_bridge);
+	if (--user->suspended_moh == 0 && user->playing_moh) {
+		ast_moh_start(user->chan, user->u_profile.moh_class, NULL);
+	}
+	ao2_unlock(user->conference_bridge);
+}
+
+/*!
+ * \internal
+ * \brief Suspend MOH for the conference user.
+ *
+ * \param user Conference user to suspend MOH on.
+ *
+ * \return Nothing
+ */
+static void conf_moh_suspend(struct conference_bridge_user *user)
+{
+	ao2_lock(user->conference_bridge);
+	if (user->suspended_moh++ == 0 && user->playing_moh) {
+		ast_moh_stop(user->chan);
+	}
+	ao2_unlock(user->conference_bridge);
+}
+
 int conf_handle_first_marked_common(struct conference_bridge_user *cbu)
 {
 	if (!ast_test_flag(&cbu->u_profile, USER_OPT_QUIET) && play_prompt_to_user(cbu, conf_get_sound(CONF_SOUND_PLACE_IN_CONF, cbu->b_profile.sounds))) {
@@ -919,18 +1007,11 @@
 
 int conf_handle_inactive_waitmarked(struct conference_bridge_user *cbu)
 {
-	/* Be sure we are muted so we can't talk to anybody else waiting */
-	cbu->features.mute = 1;
 	/* If we have not been quieted play back that they are waiting for the leader */
 	if (!ast_test_flag(&cbu->u_profile, USER_OPT_QUIET) && play_prompt_to_user(cbu,
 			conf_get_sound(CONF_SOUND_WAIT_FOR_LEADER, cbu->b_profile.sounds))) {
 		/* user hungup while the sound was playing */
 		return -1;
-	}
-	/* Start music on hold if needed */
-	if (ast_test_flag(&cbu->u_profile, USER_OPT_MUSICONHOLD)) {
-		ast_moh_start(cbu->chan, cbu->u_profile.moh_class, NULL);
-		cbu->playing_moh = 1;
 	}
 	return 0;
 }
@@ -970,11 +1051,8 @@
 	/* If we are the second participant we may need to stop music on hold on the first */
 	struct conference_bridge_user *first_participant = AST_LIST_FIRST(&conference_bridge->active_list);
 
-	/* Temporarily suspend the above participant from the bridge so we have control to stop MOH if needed */
-	if (ast_test_flag(&first_participant->u_profile, USER_OPT_MUSICONHOLD) && !ast_bridge_suspend(conference_bridge->bridge, first_participant->chan)) {
-		first_participant->playing_moh = 0;
-		ast_moh_stop(first_participant->chan);
-		ast_bridge_unsuspend(conference_bridge->bridge, first_participant->chan);
+	if (ast_test_flag(&first_participant->u_profile, USER_OPT_MUSICONHOLD)) {
+		conf_moh_stop(first_participant);
 	}
 	if (!ast_test_flag(&first_participant->u_profile, USER_OPT_STARTMUTED)) {
 		first_participant->features.mute = 0;
@@ -1098,6 +1176,13 @@
 	conference_bridge_user->conference_bridge = conference_bridge;
 
 	ao2_lock(conference_bridge);
+
+	/*
+	 * Suspend any MOH until the user actually joins the bridge of
+	 * the conference.  This way any pre-join file playback does not
+	 * need to worry about MOH.
+	 */
+	conference_bridge_user->suspended_moh = 1;
 
 	if (handle_conf_user_join(conference_bridge_user)) {
 		/* Invalid event, nothing was done, so we don't want to process a leave. */
@@ -1530,20 +1615,17 @@
 	/* Play the Join sound to both the conference and the user entering. */
 	if (!quiet) {
 		const char *join_sound = conf_get_sound(CONF_SOUND_JOIN, conference_bridge_user.b_profile.sounds);
-		if (conference_bridge_user.playing_moh) {
-			ast_moh_stop(chan);
-		}
+
 		ast_stream_and_wait(chan, join_sound, "");
 		ast_autoservice_start(chan);
 		play_sound_file(conference_bridge, join_sound);
 		ast_autoservice_stop(chan);
-		if (conference_bridge_user.playing_moh) {
-			ast_moh_start(chan, conference_bridge_user.u_profile.moh_class, NULL);
-		}
 	}
 
 	/* See if we need to automatically set this user as a video source or not */
 	handle_video_on_join(conference_bridge, conference_bridge_user.chan, ast_test_flag(&conference_bridge_user.u_profile, USER_OPT_MARKEDUSER));
+
+	conf_moh_unsuspend(&conference_bridge_user);
 
 	/* Join our conference bridge for real */
 	send_join_event(conference_bridge_user.chan, conference_bridge->name);
@@ -1925,25 +2007,14 @@
 	struct conf_menu_entry *menu_entry,
 	struct conf_menu *menu)
 {
-	struct conference_bridge *conference_bridge = conference_bridge_user->conference_bridge;
-
 	/* See if music on hold is playing */
-	ao2_lock(conference_bridge);
-	if (conference_bridge_user->playing_moh) {
-		/* MOH is going, let's stop it */
-		ast_moh_stop(bridge_channel->chan);
-	}
-	ao2_unlock(conference_bridge);
+	conf_moh_suspend(conference_bridge_user);
 
 	/* execute the list of actions associated with this menu entry */
-	execute_menu_entry(conference_bridge, conference_bridge_user, bridge_channel, menu_entry, menu);
+	execute_menu_entry(conference_bridge_user->conference_bridge, conference_bridge_user, bridge_channel, menu_entry, menu);
 
 	/* See if music on hold needs to be started back up again */
-	ao2_lock(conference_bridge);
-	if (conference_bridge_user->playing_moh) {
-		ast_moh_start(bridge_channel->chan, conference_bridge_user->u_profile.moh_class, NULL);
-	}
-	ao2_unlock(conference_bridge);
+	conf_moh_unsuspend(conference_bridge_user);
 
 	return 0;
 }
@@ -2835,13 +2906,7 @@
 	/* Turn on MOH/mute if the single participant is set up for it */
 	if (ast_test_flag(&only_participant->u_profile, USER_OPT_MUSICONHOLD)) {
 		only_participant->features.mute = 1;
-		if (!ast_channel_internal_bridge(only_participant->chan) || !ast_bridge_suspend(conference_bridge->bridge, only_participant->chan)) {
-			ast_moh_start(only_participant->chan, only_participant->u_profile.moh_class, NULL);
-			only_participant->playing_moh = 1;
-			if (ast_channel_internal_bridge(only_participant->chan)) {
-				ast_bridge_unsuspend(conference_bridge->bridge, only_participant->chan);
-			}
-		}
+		conf_moh_start(only_participant);
 	}
 }
 

Modified: team/may/chan_ooh323_evo/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_evo/apps/app_queue.c?view=diff&rev=378194&r1=378193&r2=378194
==============================================================================
--- team/may/chan_ooh323_evo/apps/app_queue.c (original)
+++ team/may/chan_ooh323_evo/apps/app_queue.c Fri Dec 21 15:35:32 2012
@@ -1630,12 +1630,12 @@
  * Lock interface list find sc, iterate through each queues queue_member list for member to
  * update state inside queues
 */
-static int update_status(struct call_queue *q, struct member *m, const int status)
+static void update_status(struct call_queue *q, struct member *m, const int status)
 {
 	m->status = status;
 
 	if (q->maskmemberstatus) {
-		return 0;
+		return;
 	}
 
 	/*** DOCUMENTATION
@@ -1707,8 +1707,6 @@
 		q->name, m->interface, m->membername, m->state_interface, m->dynamic ? "dynamic" : m->realtime ? "realtime" : "static",
 		m->penalty, m->calls, (int)m->lastcall, m->status, m->paused
 	);
-
-	return 0;
 }
 
 /*!
@@ -3650,18 +3648,8 @@
 	ast_channel_unlock(tmp->chan);
 	ast_channel_unlock(qe->chan);
 
-	ao2_lock(tmp->member);
-	update_status(qe->parent, tmp->member, get_queue_member_status(tmp->member));
-	if (!qe->parent->ringinuse && (tmp->member->status != AST_DEVICE_NOT_INUSE) && (tmp->member->status != AST_DEVICE_UNKNOWN)) {
-		ast_verb(1, "Member %s is busy, cannot dial", tmp->member->interface);
-		res = -1;
-	}
-	else {
-		/* Place the call, but don't wait on the answer */
-		res = ast_call(tmp->chan, location, 0);
-	}
-	ao2_unlock(tmp->member);
-	if (res) {
+	/* Place the call, but don't wait on the answer */
+	if ((res = ast_call(tmp->chan, location, 0))) {
 		/* Again, keep going even if there's an error */
 		ast_verb(3, "Couldn't call %s\n", tmp->interface);
 		do_hang(tmp);

Modified: team/may/chan_ooh323_evo/apps/confbridge/conf_state.c
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_evo/apps/confbridge/conf_state.c?view=diff&rev=378194&r1=378193&r2=378194
==============================================================================
--- team/may/chan_ooh323_evo/apps/confbridge/conf_state.c (original)
+++ team/may/chan_ooh323_evo/apps/confbridge/conf_state.c Fri Dec 21 15:35:32 2012
@@ -47,9 +47,28 @@
 	ast_log(LOG_ERROR, "Invalid event for confbridge user '%s'\n", cbu->u_profile.name);
 }
 
+/*!
+ * \internal
+ * \brief Mute the user and play MOH if the user requires it.
+ *
+ * \param user Conference user to mute and optionally start MOH on.
+ *
+ * \return Nothing
+ */
+static void conf_mute_moh_inactive_waitmarked(struct conference_bridge_user *user)
+{
+	/* Be sure we are muted so we can't talk to anybody else waiting */
+	user->features.mute = 1;
+	/* Start music on hold if needed */
+	if (ast_test_flag(&user->u_profile, USER_OPT_MUSICONHOLD)) {
+		conf_moh_start(user);
+	}
+}
+
 void conf_default_join_waitmarked(struct conference_bridge_user *cbu)
 {
 	conf_add_user_waiting(cbu->conference_bridge, cbu);
+	conf_mute_moh_inactive_waitmarked(cbu);
 	conf_add_post_join_action(cbu, conf_handle_inactive_waitmarked);
 }
 

Modified: team/may/chan_ooh323_evo/apps/confbridge/conf_state_multi_marked.c
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_evo/apps/confbridge/conf_state_multi_marked.c?view=diff&rev=378194&r1=378193&r2=378194
==============================================================================
--- team/may/chan_ooh323_evo/apps/confbridge/conf_state_multi_marked.c (original)
+++ team/may/chan_ooh323_evo/apps/confbridge/conf_state_multi_marked.c Fri Dec 21 15:35:32 2012
@@ -107,12 +107,8 @@
 				cbu_iter->conference_bridge->waitingusers++;
 				/* Handle muting/moh of cbu_iter if necessary */
 				if (ast_test_flag(&cbu_iter->u_profile, USER_OPT_MUSICONHOLD)) {
-				   cbu_iter->features.mute = 1;
-					if (!ast_bridge_suspend(cbu_iter->conference_bridge->bridge, cbu_iter->chan)) {
-						ast_moh_start(cbu_iter->chan, cbu_iter->u_profile.moh_class, NULL);
-						cbu_iter->playing_moh = 1;
-						ast_bridge_unsuspend(cbu_iter->conference_bridge->bridge, cbu_iter->chan);
-					}
+					cbu_iter->features.mute = 1;
+					conf_moh_start(cbu_iter);
 				}
 			}
 		}
@@ -173,10 +169,8 @@
 		cbu->conference_bridge->waitingusers--;
 		AST_LIST_INSERT_TAIL(&cbu->conference_bridge->active_list, cbu_iter, list);
 		cbu->conference_bridge->activeusers++;
-		if (cbu_iter->playing_moh && !ast_bridge_suspend(cbu->conference_bridge->bridge, cbu_iter->chan)) {
-			cbu_iter->playing_moh = 0;
-			ast_moh_stop(cbu_iter->chan);
-			ast_bridge_unsuspend(cbu->conference_bridge->bridge, cbu_iter->chan);
+		if (cbu_iter->playing_moh) {
+			conf_moh_stop(cbu_iter);
 		}
 		/* only unmute them if they are not supposed to start muted */
 		if (!ast_test_flag(&cbu_iter->u_profile, USER_OPT_STARTMUTED)) {

Modified: team/may/chan_ooh323_evo/apps/confbridge/include/confbridge.h
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_evo/apps/confbridge/include/confbridge.h?view=diff&rev=378194&r1=378193&r2=378194
==============================================================================
--- team/may/chan_ooh323_evo/apps/confbridge/include/confbridge.h (original)
+++ team/may/chan_ooh323_evo/apps/confbridge/include/confbridge.h Fri Dec 21 15:35:32 2012
@@ -236,6 +236,7 @@
 	struct ast_channel *chan;                    /*!< Asterisk channel participating */
 	struct ast_bridge_features features;         /*!< Bridge features structure */
 	struct ast_bridge_tech_optimizations tech_args; /*!< Bridge technology optimizations for talk detection */
+	unsigned int suspended_moh;                  /*!< Count of active suspended MOH actions. */
 	unsigned int kicked:1;                       /*!< User has been kicked from the conference */
 	unsigned int playing_moh:1;                  /*!< MOH is currently being played to the user */
 	AST_LIST_HEAD_NOLOCK(, post_join_action) post_join_list; /*!< List of sounds to play after joining */;
@@ -358,6 +359,24 @@
  */
 void conf_ended(struct conference_bridge *conference_bridge);
 
+/*!
+ * \brief Stop MOH for the conference user.
+ *
+ * \param user Conference user to stop MOH on.
+ *
+ * \return Nothing
+ */
+void conf_moh_stop(struct conference_bridge_user *user);
+
+/*!
+ * \brief Start MOH for the conference user.
+ *
+ * \param user Conference user to start MOH on.
+ *
+ * \return Nothing
+ */
+void conf_moh_start(struct conference_bridge_user *user);
+
 /*! \brief Attempt to mute/play MOH to the only user in the conference if they require it
  * \param conference_bridge A conference bridge containing a single user
  */

Modified: team/may/chan_ooh323_evo/channels/chan_agent.c
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_evo/channels/chan_agent.c?view=diff&rev=378194&r1=378193&r2=378194
==============================================================================
--- team/may/chan_ooh323_evo/channels/chan_agent.c (original)
+++ team/may/chan_ooh323_evo/channels/chan_agent.c Fri Dec 21 15:35:32 2012
@@ -1442,8 +1442,9 @@
 	AST_LIST_TRAVERSE(&agents, p, list) {
 		ast_mutex_lock(&p->lock);
 		if (!p->pending && ((groupmatch && (p->group & groupmatch)) || !strcmp(data, p->agent))) {
-			if (p->chan)
+			if (p->chan) {
 				hasagent++;
+			}
 			now = ast_tvnow();
 			if (!p->lastdisc.tv_sec || (now.tv_sec >= p->lastdisc.tv_sec)) {
 				p->lastdisc = ast_tv(0, 0);
@@ -1459,30 +1460,6 @@
 			}
 		}
 		ast_mutex_unlock(&p->lock);
-	}
-	if (!p) {
-		AST_LIST_TRAVERSE(&agents, p, list) {
-			ast_mutex_lock(&p->lock);
-			if (!p->pending && ((groupmatch && (p->group & groupmatch)) || !strcmp(data, p->agent))) {
-				if (p->chan) {
-					hasagent++;
-				}
-				now = ast_tvnow();
-				if (!p->lastdisc.tv_sec || (now.tv_sec >= p->lastdisc.tv_sec)) {
-					p->lastdisc = ast_tv(0, 0);
-					/* Agent must be registered, but not have any active call, and not be in a waiting state */
-					if (!p->owner && p->chan) {
-						/* Could still get a fixed agent */
-						chan = agent_new(p, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL, callid);
-					}
-					if (chan) {
-						ast_mutex_unlock(&p->lock);
-						break;
-					}
-				}
-			}
-			ast_mutex_unlock(&p->lock);
-		}
 	}
 
 	if (!chan && waitforagent) {

Modified: team/may/chan_ooh323_evo/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_evo/channels/chan_local.c?view=diff&rev=378194&r1=378193&r2=378194
==============================================================================
--- team/may/chan_ooh323_evo/channels/chan_local.c (original)
+++ team/may/chan_ooh323_evo/channels/chan_local.c Fri Dec 21 15:35:32 2012
@@ -151,8 +151,6 @@
 	struct ast_jb_conf jb_conf;     /*!< jitterbuffer configuration for this local channel */
 	struct ast_channel *owner;      /*!< Master Channel - Bridging happens here */
 	struct ast_channel *chan;       /*!< Outbound channel - PBX is run here */
-	struct ast_module_user *u_owner;/*!< reference to keep the module loaded while in use */
-	struct ast_module_user *u_chan; /*!< reference to keep the module loaded while in use */
 };
 
 #define LOCAL_ALREADY_MASQED  (1 << 0) /*!< Already masqueraded */
@@ -161,7 +159,7 @@
 #define LOCAL_BRIDGE          (1 << 3) /*!< Report back the "true" channel as being bridged to */
 #define LOCAL_MOH_PASSTHRU    (1 << 4) /*!< Pass through music on hold start/stop frames */
 
-/* 
+/*!
  * \brief Send a pvt in with no locks held and get all locks
  *
  * \note NO locks should be held prior to calling this function
@@ -175,8 +173,8 @@
 	struct ast_channel *chan = NULL;
 	struct ast_channel *owner = NULL;
 
+	ao2_lock(p);
 	for (;;) {
-		ao2_lock(p);
 		if (p->chan) {
 			chan = p->chan;
 			ast_channel_ref(chan);
@@ -194,12 +192,11 @@
 			} else if(chan) {
 				ast_channel_lock(chan);
 			}
-			ao2_lock(p);
 		} else {
 			/* lock both channels first, then get the pvt lock */
 			ast_channel_lock_both(chan, owner);
-			ao2_lock(p);
-		}
+		}
+		ao2_lock(p);
 
 		/* Now that we have all the locks, validate that nothing changed */
 		if (p->owner != owner || p->chan != chan) {
@@ -211,7 +208,6 @@
 				ast_channel_unlock(chan);
 				chan = ast_channel_unref(chan);
 			}
-			ao2_unlock(p);
 			continue;
 		}
 
@@ -225,7 +221,7 @@
 static int local_setoption(struct ast_channel *ast, int option, void * data, int datalen)
 {
 	int res = 0;
-	struct local_pvt *p = NULL;
+	struct local_pvt *p;
 	struct ast_channel *otherchan = NULL;
 	ast_chan_write_info_t *write_info;
 
@@ -272,9 +268,7 @@
 	ast_channel_unlock(otherchan);
 
 setoption_cleanup:
-	if (p) {
-		ao2_ref(p, -1);
-	}
+	ao2_ref(p, -1);
 	if (otherchan) {
 		ast_channel_unref(otherchan);
 	}
@@ -286,27 +280,31 @@
 static int local_devicestate(const char *data)
 {
 	char *exten = ast_strdupa(data);
-	char *context = NULL, *opts = NULL;
+	char *context;
+	char *opts;
 	int res;
 	struct local_pvt *lp;
 	struct ao2_iterator it;
 
-	if (!(context = strchr(exten, '@'))) {
-		ast_log(LOG_WARNING, "Someone used Local/%s somewhere without a @context. This is bad.\n", exten);
+	/* Strip options if they exist */
+	opts = strchr(exten, '/');
+	if (opts) {
+		*opts = '\0';
+	}
+
+	context = strchr(exten, '@');
+	if (!context) {
+		ast_log(LOG_WARNING,
+			"Someone used Local/%s somewhere without a @context. This is bad.\n", data);
+		return AST_DEVICE_INVALID;	
+	}
+	*context++ = '\0';
+
+	ast_debug(3, "Checking if extension %s@%s exists (devicestate)\n", exten, context);
+	res = ast_exists_extension(NULL, context, exten, 1, NULL);
+	if (!res) {
 		return AST_DEVICE_INVALID;
 	}
-
-	*context++ = '\0';
-
-	/* Strip options if they exist */
-	if ((opts = strchr(context, '/')))
-		*opts = '\0';
-
-	ast_debug(3, "Checking if extension %s@%s exists (devicestate)\n", exten, context);
-
-	res = ast_exists_extension(NULL, context, exten, 1, NULL);
-	if (!res)
-		return AST_DEVICE_INVALID;
 
 	res = AST_DEVICE_NOT_INUSE;
 
@@ -468,8 +466,8 @@
 		return -1;
 	}
 
+	ao2_ref(p, 1);
 	ao2_lock(p);
-	ao2_ref(p, 1);
 	isoutbound = IS_OUTBOUND(ast, p);
 	if (isoutbound) {
 		/* Pass along answer since somebody answered us */
@@ -676,7 +674,7 @@
 	ao2_lock(p);
 
 	if ((p->owner != oldchan) && (p->chan != oldchan)) {
-		ast_log(LOG_WARNING, "Old channel wasn't %p but was %p/%p\n", oldchan, p->owner, p->chan);
+		ast_log(LOG_WARNING, "Old channel %p wasn't %p or %p\n", oldchan, p->owner, p->chan);
 		ao2_unlock(p);
 		return -1;
 	}
@@ -839,8 +837,8 @@
 		return -1;
 	}
 
+	ao2_ref(p, 1); /* ref for local_queue_frame */
 	ao2_lock(p);
-	ao2_ref(p, 1); /* ref for local_queue_frame */
 	isoutbound = IS_OUTBOUND(ast, p);
 	f.data.ptr = (char *) text;
 	f.datalen = strlen(text) + 1;
@@ -861,8 +859,8 @@
 		return -1;
 	}
 
+	ao2_ref(p, 1); /* ref for local_queue_frame */
 	ao2_lock(p);
-	ao2_ref(p, 1); /* ref for local_queue_frame */
 	isoutbound = IS_OUTBOUND(ast, p);
 	f.subclass.integer = subclass;
 	f.data.ptr = (char *)data;
@@ -1085,16 +1083,15 @@
 
 	if (isoutbound) {
 		const char *status = pbx_builtin_getvar_helper(p->chan, "DIALSTATUS");
-		if ((status) && (p->owner)) {
+
+		if (status && p->owner) {
 			ast_channel_hangupcause_set(p->owner, ast_channel_hangupcause(p->chan));
 			pbx_builtin_setvar_helper(p->owner, "CHANLOCALSTATUS", status);
 		}
 
 		ast_clear_flag(p, LOCAL_LAUNCHED_PBX);
-		ast_module_user_remove(p->u_chan);
 		p->chan = NULL;
 	} else {
-		ast_module_user_remove(p->u_owner);
 		if (p->chan) {
 			ast_queue_hangup(p->chan);
 		}
@@ -1105,6 +1102,7 @@
 
 	if (!p->owner && !p->chan) {
 		ao2_unlock(p);
+
 		/* Remove from list */
 		ao2_unlink(locals, p);
 		ao2_ref(p, -1);
@@ -1124,6 +1122,10 @@
 		ao2_unlock(p);
 		ao2_ref(p, -1);
 	}
+	if (owner) {
+		ast_channel_unlock(owner);
+		owner = ast_channel_unref(owner);
+	}
 	if (chan) {
 		ast_channel_unlock(chan);
 		if (hangup_chan) {
@@ -1131,29 +1133,38 @@
 		}
 		chan = ast_channel_unref(chan);
 	}
-	if (owner) {
-		ast_channel_unlock(owner);
-		owner = ast_channel_unref(owner);
-	}
 
 	/* leave with the same stupid channel locked that came in */
 	ast_channel_lock(ast);
 	return res;
 }
 
-static void local_destroy(void *obj)
-{
-	struct local_pvt *pvt = obj;
-	pvt->reqcap = ast_format_cap_destroy(pvt->reqcap);
+/*!
+ * \internal
+ * \brief struct local_pvt destructor.
+ *
+ * \param vdoomed Void local_pvt to destroy.
+ *
+ * \return Nothing
+ */
+static void local_pvt_destructor(void *vdoomed)
+{
+	struct local_pvt *doomed = vdoomed;
+
+	doomed->reqcap = ast_format_cap_destroy(doomed->reqcap);
+
+	ast_module_unref(ast_module_info->self);
 }
 
 /*! \brief Create a call structure */
 static struct local_pvt *local_alloc(const char *data, struct ast_format_cap *cap)
 {

[... 781 lines stripped ...]



More information about the asterisk-commits mailing list