[asterisk-dev] [Code Review] Add tests for L() and S() bridging options

opticron reviewboard at asterisk.org
Fri Dec 14 10:47:35 CST 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2247/
-----------------------------------------------------------

Review request for Asterisk Developers.


Summary
-------

This addtion to the testsuite tests the S() bridging option which hangs up the call a specified time after the call is answered, and the L() bridging option which provides the ability to play warnings to one or both parties in addition to hanging up the call at the desired time after the answer.  This requires the following test events to be added to work properly:

Index: main/channel.c
===================================================================
--- main/channel.c      (revision 377981)
+++ main/channel.c      (working copy)
@@ -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;
                        }


This addresses bug SWP-4713.
    https://issues.asterisk.org/jira/browse/SWP-4713


Diffs
-----

  asterisk/trunk/tests/bridge/tests.yaml 3576 
  asterisk/trunk/tests/bridge/dial_LS_options/configs/ast1/extensions.conf PRE-CREATION 
  asterisk/trunk/tests/bridge/dial_LS_options/test-config.yaml PRE-CREATION 
  asterisk/trunk/tests/bridge/dial_LS_options/Tester.py PRE-CREATION 

Diff: https://reviewboard.asterisk.org/r/2247/diff


Testing
-------

Ran the test, ensured that the tests executed properly via the logs generated.


Thanks,

opticron

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121214/a51fd49f/attachment-0001.htm>


More information about the asterisk-dev mailing list