diff options
author | Matthew Jordan <mjordan@digium.com> | 2011-12-22 20:44:53 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2011-12-22 20:44:53 +0000 |
commit | cf0c9830bf320e8b6e589b7a53b75c1fd4a94bb5 (patch) | |
tree | 0b6002bcbfc9f7a02e7c9f0ffce5dbae6cabede7 /main | |
parent | b9bf2444e0557e9ed8321d47e3d85bb1ceab5863 (diff) |
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
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/app.c | 3 | ||||
-rw-r--r-- | main/bridging.c | 5 | ||||
-rw-r--r-- | main/file.c | 2 | ||||
-rw-r--r-- | main/say.c | 2 |
4 files changed, 10 insertions, 2 deletions
diff --git a/main/app.c b/main/app.c index 367a78387..3e3cf5614 100644 --- a/main/app.c +++ b/main/app.c @@ -183,6 +183,7 @@ enum ast_getdata_result ast_app_getdata(struct ast_channel *c, const char *promp 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 ast_play_and_wait(struct ast_channel *chan, const char *fn) { 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; } diff --git a/main/bridging.c b/main/bridging.c index 5ae861785..9bc0edc82 100644 --- a/main/bridging.c +++ b/main/bridging.c @@ -41,6 +41,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #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 @@ void ast_bridge_set_single_src_video_mode(struct ast_bridge *bridge, struct ast_ 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 @@ void ast_bridge_set_talker_src_video_mode(struct ast_bridge *bridge) 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 @@ void ast_bridge_update_talker_src_video_mode(struct ast_bridge *bridge, struct a } 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); diff --git a/main/file.c b/main/file.c index f273de213..1d871fde2 100644 --- a/main/file.c +++ b/main/file.c @@ -1418,7 +1418,7 @@ int ast_stream_and_wait(struct ast_channel *chan, const char *file, const char * { 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); diff --git a/main/say.c b/main/say.c index 4c04b7957..f5d8f8bd9 100644 --- a/main/say.c +++ b/main/say.c @@ -51,6 +51,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #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 @@ static int wait_file(struct ast_channel *chan, const char *ints, const char *fil \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 */ |