[svn-commits] kmoore: trunk r378122 - in /trunk: ./ main/channel.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Dec 18 11:48:40 CST 2012


Author: kmoore
Date: Tue Dec 18 11:48:36 2012
New Revision: 378122

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=378122
Log:
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

Modified:
    trunk/   (props changed)
    trunk/main/channel.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=378122&r1=378121&r2=378122
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Tue Dec 18 11:48:36 2012
@@ -73,6 +73,7 @@
 #include "asterisk/data.h"
 #include "asterisk/channel_internal.h"
 #include "asterisk/features.h"
+#include "asterisk/test.h"
 
 /*** DOCUMENTATION
  ***/
@@ -3242,6 +3243,7 @@
 				now = ast_tvnow();
 			diff = ast_tvsub(*ast_channel_whentohangup(c[x]), now);
 			if (diff.tv_sec < 0 || ast_tvzero(diff)) {
+				ast_test_suite_event_notify("HANGUP_TIME", "Channel: %s", ast_channel_name(c[x]));
 				/* Should already be hungup */
 				ast_channel_softhangup_internal_flag_add(c[x], AST_SOFTHANGUP_TIMEOUT);
 				ast_channel_unlock(c[x]);
@@ -3315,6 +3317,7 @@
 		now = ast_tvnow();
 		for (x = 0; x < n; x++) {
 			if (!ast_tvzero(*ast_channel_whentohangup(c[x])) && ast_tvcmp(*ast_channel_whentohangup(c[x]), now) <= 0) {
+				ast_test_suite_event_notify("HANGUP_TIME", "Channel: %s", ast_channel_name(c[x]));
 				ast_channel_softhangup_internal_flag_add(c[x], AST_SOFTHANGUP_TIMEOUT);
 				if (winner == NULL) {
 					winner = c[x];
@@ -7939,6 +7942,7 @@
 					bridge_playfile(c1, c0, config->end_sound, 0);
 				*fo = NULL;
 				res = 0;
+				ast_test_suite_event_notify("BRIDGE_TIMELIMIT", "Channel1: %s\r\nChannel2: %s", ast_channel_name(c0), ast_channel_name(c1));
 				break;
 			}
 




More information about the svn-commits mailing list