[asterisk-commits] jrose: branch jrose/bridge_projects r381343 - /team/jrose/bridge_projects/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 12 16:58:39 CST 2013


Author: jrose
Date: Tue Feb 12 16:58:36 2013
New Revision: 381343

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=381343
Log:
bridge construction: Interval Hooks again

* Add BRIDGE_TIMELIMIT test event when the duration callback triggers
* Prevent warning playback from playing when the bridge channel isn't in the
waiting state.
* Change warning time to reflect how it should work by documentation and the
current implementation in Asterisk right now where the value defines how long
before the end of the call the warnings should start rather than how long
after the start of the call.

Modified:
    team/jrose/bridge_projects/main/bridging.c

Modified: team/jrose/bridge_projects/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/main/bridging.c?view=diff&rev=381343&r1=381342&r2=381343
==============================================================================
--- team/jrose/bridge_projects/main/bridging.c (original)
+++ team/jrose/bridge_projects/main/bridging.c Tue Feb 12 16:58:36 2013
@@ -2030,6 +2030,9 @@
 	default:
 		break;
 	}
+
+	ast_test_suite_event_notify("BRIDGE_TIMELIMIT", "Channel1: %s", ast_channel_name(bridge_channel->chan));
+
 	ao2_unlock(bridge_channel);
 
 	return -1;
@@ -2099,7 +2102,10 @@
 {
 	struct ast_bridge_features_limits *limits = hook_pvt;
 
-	limits_interval_playback(bridge, bridge_channel, limits, limits->warning_sound);
+	if ((bridge_channel->state == AST_BRIDGE_CHANNEL_STATE_WAIT)) {
+		/* If we aren't in the wait state, something more important than this warning is happening and we should skip it. */
+		limits_interval_playback(bridge, bridge_channel, limits, limits->warning_sound);
+	}
 
 	if (limits->frequency) {
 		ast_bridge_features_interval_update(bridge_channel, limits->frequency);
@@ -2158,7 +2164,7 @@
 	}
 
 	if (feature_limits->warning && feature_limits->warning < feature_limits->duration) {
-		ast_bridge_features_interval_hook(features, feature_limits->warning, 1,
+		ast_bridge_features_interval_hook(features, feature_limits->duration - feature_limits->warning, 1,
 			bridge_features_warning_callback,
 			feature_limits, NULL);
 	}




More information about the asterisk-commits mailing list