[svn-commits] mjordan: trunk r348848 - in /trunk: ./ apps/ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Dec 22 14:44:56 CST 2011


Author: mjordan
Date: Thu Dec 22 14:44:53 2011
New Revision: 348848

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=348848
Log:
Add Asterisk TestSuite event hooks to support ConfBridge testing

This patch adds initial testsuite event hooks so that ConfBridge tests
can be executed in the Asterisk TestSuite.

(issue ASTERISK-19059)
........

Merged revisions 348846 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    trunk/   (props changed)
    trunk/apps/app_confbridge.c
    trunk/main/app.c
    trunk/main/bridging.c
    trunk/main/file.c
    trunk/main/say.c

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

Modified: trunk/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_confbridge.c?view=diff&rev=348848&r1=348847&r2=348848
==============================================================================
--- trunk/apps/app_confbridge.c (original)
+++ trunk/apps/app_confbridge.c Thu Dec 22 14:44:53 2011
@@ -57,6 +57,7 @@
 #include "confbridge/include/confbridge.h"
 #include "asterisk/paths.h"
 #include "asterisk/manager.h"
+#include "asterisk/test.h"
 
 /*** DOCUMENTATION
     <application name="ConfBridge" language="en_US">
@@ -468,6 +469,7 @@
 
 		chan = ast_channel_unref(chan);
 		pthread_join(thread, NULL);
+		ast_test_suite_event_notify("CONF_STOP_RECORD", "Message: stopped conference recording channel\r\nConference: %s", conference_bridge->b_profile.name);
 
 		ao2_lock(conference_bridge);
 	}
@@ -520,6 +522,7 @@
 		return -1;
 	}
 
+	ast_test_suite_event_notify("CONF_START_RECORD", "Message: started conference recording channel\r\nConference: %s", conference_bridge->b_profile.name);
 	ao2_unlock(conference_bridge);
 	return 0;
 }
@@ -1545,6 +1548,7 @@
 	/* Mute or unmute yourself, note we only allow manipulation if they aren't waiting for a marked user or if marked users exist */
 	if (!ast_test_flag(&conference_bridge_user->u_profile, USER_OPT_WAITMARKED) || conference_bridge->markedusers) {
 		conference_bridge_user->features.mute = (!conference_bridge_user->features.mute ? 1 : 0);
+		ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", chan->name, conference_bridge_user->features.mute ? "muted" : "unmuted", conference_bridge_user->b_profile.name, chan->name);
 	}
 	return ast_stream_and_wait(chan, (conference_bridge_user->features.mute ?
 		conf_get_sound(CONF_SOUND_MUTED, conference_bridge_user->b_profile.sounds) :
@@ -2026,6 +2030,7 @@
 	}
 	ao2_lock(bridge);
 	bridge->locked = lock;
+	ast_test_suite_event_notify("CONF_LOCK", "Message: conference %s\r\nConference: %s", bridge->locked ? "locked" : "unlocked", bridge->b_profile.name);
 	ao2_unlock(bridge);
 	ao2_ref(bridge, -1);
 
@@ -2058,6 +2063,7 @@
 	}
 	if (participant) {
 		participant->features.mute = mute;
+		ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", participant->chan->name, participant->features.mute ? "muted" : "unmuted", bridge->b_profile.name, participant->chan->name);
 	} else {
 		res = -2;;
 	}

Modified: trunk/main/app.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/app.c?view=diff&rev=348848&r1=348847&r2=348848
==============================================================================
--- trunk/main/app.c (original)
+++ trunk/main/app.c Thu Dec 22 14:44:53 2011
@@ -183,6 +183,7 @@
 
 	filename = ast_strdupa(prompt);
 	while ((front = strsep(&filename, "&"))) {
+		ast_test_suite_event_notify("PLAYBACK", "Message: %s\r\nChannel: %s", front, c->name);
 		if (!ast_strlen_zero(front)) {
 			res = ast_streamfile(c, front, c->language);
 			if (res)
@@ -699,7 +700,7 @@
 {
 	int d = 0;
 
-	ast_test_suite_event_notify("PLAYBACK", "Message: %s", fn);
+	ast_test_suite_event_notify("PLAYBACK", "Message: %s\r\nChannel: %s", fn, chan->name);
 	if ((d = ast_streamfile(chan, fn, chan->language))) {
 		return d;
 	}

Modified: trunk/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/bridging.c?view=diff&rev=348848&r1=348847&r2=348848
==============================================================================
--- trunk/main/bridging.c (original)
+++ trunk/main/bridging.c Thu Dec 22 14:44:53 2011
@@ -41,6 +41,7 @@
 #include "asterisk/file.h"
 #include "asterisk/module.h"
 #include "asterisk/astobj2.h"
+#include "asterisk/test.h"
 
 static AST_RWLIST_HEAD_STATIC(bridge_technologies, ast_bridge_technology);
 
@@ -1510,6 +1511,7 @@
 	cleanup_video_mode(bridge);
 	bridge->video_mode.mode = AST_BRIDGE_VIDEO_MODE_SINGLE_SRC;
 	bridge->video_mode.mode_data.single_src_data.chan_vsrc = ast_channel_ref(video_src_chan);
+	ast_test_suite_event_notify("BRIDGE_VIDEO_MODE", "Message: video mode set to single source\r\nVideo Mode: %d\r\nVideo Channel: %s", bridge->video_mode.mode, video_src_chan->name);
 	ast_indicate(video_src_chan, AST_CONTROL_VIDUPDATE);
 	ao2_unlock(bridge);
 }
@@ -1519,6 +1521,7 @@
 	ao2_lock(bridge);
 	cleanup_video_mode(bridge);
 	bridge->video_mode.mode = AST_BRIDGE_VIDEO_MODE_TALKER_SRC;
+	ast_test_suite_event_notify("BRIDGE_VIDEO_MODE", "Message: video mode set to talker source\r\nVideo Mode: %d", bridge->video_mode.mode);
 	ao2_unlock(bridge);
 }
 
@@ -1545,12 +1548,14 @@
 		}
 		data->chan_vsrc = ast_channel_ref(chan);
 		data->average_talking_energy = talker_energy;
+		ast_test_suite_event_notify("BRIDGE_VIDEO_SRC", "Message: video source updated\r\nVideo Channel: %s", data->chan_vsrc->name);
 		ast_indicate(data->chan_vsrc, AST_CONTROL_VIDUPDATE);
 	} else if ((data->average_talking_energy < talker_energy) && !is_keyframe) {
 		ast_indicate(chan, AST_CONTROL_VIDUPDATE);
 	} else if (!data->chan_vsrc && is_keyframe) {
 		data->chan_vsrc = ast_channel_ref(chan);
 		data->average_talking_energy = talker_energy;
+		ast_test_suite_event_notify("BRIDGE_VIDEO_SRC", "Message: video source updated\r\nVideo Channel: %s", data->chan_vsrc->name);
 		ast_indicate(chan, AST_CONTROL_VIDUPDATE);
 	} else if (!data->chan_old_vsrc && is_keyframe) {
 		data->chan_old_vsrc = ast_channel_ref(chan);

Modified: trunk/main/file.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/file.c?view=diff&rev=348848&r1=348847&r2=348848
==============================================================================
--- trunk/main/file.c (original)
+++ trunk/main/file.c Thu Dec 22 14:44:53 2011
@@ -1418,7 +1418,7 @@
 {
 	int res = 0;
 	if (!ast_strlen_zero(file)) {
-		ast_test_suite_event_notify("PLAYBACK", "Message: %s", file);
+		ast_test_suite_event_notify("PLAYBACK", "Message: %s\r\nChannel: %s", file, chan->name);
 		res = ast_streamfile(chan, file, chan->language);
 		if (!res) {
 			res = ast_waitstream(chan, digits);

Modified: trunk/main/say.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/say.c?view=diff&rev=348848&r1=348847&r2=348848
==============================================================================
--- trunk/main/say.c (original)
+++ trunk/main/say.c Thu Dec 22 14:44:53 2011
@@ -51,6 +51,7 @@
 #include "asterisk/localtime.h"
 #include "asterisk/utils.h"
 #include "asterisk/app.h"
+#include "asterisk/test.h"
 
 /* Forward declaration */
 static int wait_file(struct ast_channel *chan, const char *ints, const char *file, const char *lang);
@@ -433,6 +434,7 @@
      \note Called from AGI */
 static int say_number_full(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
 {
+	ast_test_suite_event_notify("SAYNUM", "Message: saying number %d\r\nNumber: %d\r\nChannel: %s", num, num, chan->name);
 	if (!strncasecmp(language, "en_GB", 5)) {     /* British syntax */
 	   return ast_say_number_full_en_GB(chan, num, ints, language, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "en", 2)) { /* English syntax */




More information about the svn-commits mailing list