[asterisk-commits] dlee: branch dlee/stasis-cache-split r395706 - in /team/dlee/stasis-cache-spl...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 29 15:08:12 CDT 2013


Author: dlee
Date: Mon Jul 29 15:08:10 2013
New Revision: 395706

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395706
Log:
Merged revisions 395619-395686 from http://svn.asterisk.org/svn/asterisk/trunk

Modified:
    team/dlee/stasis-cache-split/   (props changed)
    team/dlee/stasis-cache-split/include/asterisk/mixmonitor.h   (props changed)
    team/dlee/stasis-cache-split/main/loader.c
    team/dlee/stasis-cache-split/main/mixmonitor.c   (props changed)
    team/dlee/stasis-cache-split/res/ari/   (props changed)
    team/dlee/stasis-cache-split/res/parking/parking_devicestate.c   (props changed)
    team/dlee/stasis-cache-split/res/res_sip.c
    team/dlee/stasis-cache-split/tests/test_cel.c

Propchange: team/dlee/stasis-cache-split/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jul 29 15:08:10 2013
@@ -1,1 +1,1 @@
-/trunk:1-395603
+/trunk:1-395705

Propchange: team/dlee/stasis-cache-split/include/asterisk/mixmonitor.h
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jul 29 15:08:10 2013
@@ -1,1 +1,1 @@
-"Author Date Id Revision"
+Author Date Id Revision

Modified: team/dlee/stasis-cache-split/main/loader.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/main/loader.c?view=diff&rev=395706&r1=395705&r2=395706
==============================================================================
--- team/dlee/stasis-cache-split/main/loader.c (original)
+++ team/dlee/stasis-cache-split/main/loader.c Mon Jul 29 15:08:10 2013
@@ -50,7 +50,7 @@
 #include "asterisk/enum.h"
 #include "asterisk/http.h"
 #include "asterisk/lock.h"
-#include "asterisk/features.h"
+#include "asterisk/features_config.h"
 #include "asterisk/dsp.h"
 #include "asterisk/udptl.h"
 #include "asterisk/heap.h"
@@ -313,7 +313,7 @@
 	{ "manager",	reload_manager },
 	{ "http",	ast_http_reload },
 	{ "logger",	logger_reload },
-	{ "features",	ast_features_reload },
+	{ "features",	ast_features_config_reload },
 	{ "dsp",	ast_dsp_reload},
 	{ "udptl",	ast_udptl_reload },
 	{ "indications", ast_indications_reload },

Propchange: team/dlee/stasis-cache-split/main/mixmonitor.c
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jul 29 15:08:10 2013
@@ -1,1 +1,1 @@
-"Author Date Id Revision"
+Author Date Id Revision

Propchange: team/dlee/stasis-cache-split/res/ari/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Jul 29 15:08:10 2013
@@ -1,0 +1,2 @@
+*.i
+*.o

Propchange: team/dlee/stasis-cache-split/res/parking/parking_devicestate.c
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jul 29 15:08:10 2013
@@ -1,1 +1,1 @@
-"Author Date Id Revision"
+Author Date Id Revision

Modified: team/dlee/stasis-cache-split/res/res_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/res/res_sip.c?view=diff&rev=395706&r1=395705&r2=395706
==============================================================================
--- team/dlee/stasis-cache-split/res/res_sip.c (original)
+++ team/dlee/stasis-cache-split/res/res_sip.c Mon Jul 29 15:08:10 2013
@@ -292,17 +292,26 @@
 					</description>
 				</configOption>
 				<configOption name="trust_id_inbound" default="no">
-					<synopsis>Trust inbound CallerID information from endpoint</synopsis>
-					<description><para>This option determines whether res_sip will accept identification from the endpoint
-					received in a P-Asserted-Identity or Remote-Party-ID header. If <literal>no</literal>,
-					the configured Caller-ID from res_sip.conf will always be used as the identity for the
-					endpoint.</para></description>
+					<synopsis>Accept identification information received from this endpoint</synopsis>
+					<description><para>This option determines whether Asterisk will accept
+					identification from the endpoint from headers such as P-Asserted-Identity
+					or Remote-Party-ID header. This option applies both to calls originating from the
+					endpoint and calls originating from Asterisk. If <literal>no</literal>, the
+					configured Caller-ID from res_sip.conf will always be used as the identity for
+					the endpoint.</para></description>
 				</configOption>
 				<configOption name="trust_id_outbound" default="no">
-					<synopsis>Trust endpoint with private CallerID information</synopsis>
-					<description><para>This option determines whether res_sip will send identification
-					information to the endpoint that has been marked as private. If <literal>no</literal>,
-					private Caller-ID information will not be forwarded to the endpoint.</para></description>
+					<synopsis>Send private identification details to the endpoint.</synopsis>
+					<description><para>This option determines whether res_sip will send private
+					identification information to the endpoint. If <literal>no</literal>,
+					private Caller-ID information will not be forwarded to the endpoint.
+					"Private" in this case refers to any method of restricting identification.
+					Example: setting <replaceable>callerid_privacy</replaceable> to any
+					<literal>prohib</literal> variation.
+					Example: If <replaceable>trust_id_inbound</replaceable> is set to
+					<literal>yes</literal>, the presence of a <literal>Privacy: id</literal>
+					header in a SIP request or response would indicate the identification
+					provided in the request is private.</para></description>
 				</configOption>
 				<configOption name="type">
 					<synopsis>Must be of type 'endpoint'.</synopsis>
@@ -1789,7 +1798,6 @@
 		ast_pjsip_endpoint = NULL;
 	}
 	pj_caching_pool_destroy(&caching_pool);
-	/* XXX Should have a way of stopping monitor thread */
 	return AST_MODULE_LOAD_DECLINE;
 }
 

Modified: team/dlee/stasis-cache-split/tests/test_cel.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/tests/test_cel.c?view=diff&rev=395706&r1=395705&r2=395706
==============================================================================
--- team/dlee/stasis-cache-split/tests/test_cel.c (original)
+++ team/dlee/stasis-cache-split/tests/test_cel.c Mon Jul 29 15:08:10 2013
@@ -160,12 +160,6 @@
 /*! \brief David's Caller ID */
 #define DAVID_CALLERID { .id.name.str = "David", .id.name.valid = 1, .id.number.str = "400", .id.number.valid = 1, }
 
-/*! \brief Eve's Caller ID */
-#define EVE_CALLERID { .id.name.str = "Eve", .id.name.valid = 1, .id.number.str = "500", .id.number.valid = 1, }
-
-/*! \brief Fred's Caller ID */
-#define FRED_CALLERID { .id.name.str = "Fred", .id.name.valid = 1, .id.number.str = "600", .id.number.valid = 1, }
-
 /*! \brief Create a \ref test_cel_chan_tech for Alice. */
 #define CREATE_ALICE_CHANNEL(channel_var, caller_id) do { \
 	(channel_var) = ast_channel_alloc(0, AST_STATE_DOWN, (caller_id)->id.number.str, (caller_id)->id.name.str, "100", "100", "default", NULL, 0, CHANNEL_TECH_NAME "/Alice"); \
@@ -187,18 +181,6 @@
 /*! \brief Create a \ref test_cel_chan_tech for David. */
 #define CREATE_DAVID_CHANNEL(channel_var, caller_id) do { \
 	(channel_var) = ast_channel_alloc(0, AST_STATE_DOWN, (caller_id)->id.number.str, (caller_id)->id.name.str, "400", "400", "default", NULL, 0, CHANNEL_TECH_NAME "/David"); \
-	APPEND_EVENT(channel_var, AST_CEL_CHANNEL_START, NULL, NULL, NULL); \
-	} while (0)
-
-/*! \brief Create a \ref test_cel_chan_tech for Eve. */
-#define CREATE_EVE_CHANNEL(channel_var, caller_id) do { \
-	(channel_var) = ast_channel_alloc(0, AST_STATE_DOWN, (caller_id)->id.number.str, (caller_id)->id.name.str, "500", "500", "default", NULL, 0, CHANNEL_TECH_NAME "/Eve"); \
-	APPEND_EVENT(channel_var, AST_CEL_CHANNEL_START, NULL, NULL, NULL); \
-	} while (0)
-
-/*! \brief Create a \ref test_cel_chan_tech for Eve. */
-#define CREATE_FRED_CHANNEL(channel_var, caller_id) do { \
-	(channel_var) = ast_channel_alloc(0, AST_STATE_DOWN, (caller_id)->id.number.str, (caller_id)->id.name.str, "600", "600", "default", NULL, 0, CHANNEL_TECH_NAME "/Fred"); \
 	APPEND_EVENT(channel_var, AST_CEL_CHANNEL_START, NULL, NULL, NULL); \
 	} while (0)
 
@@ -610,13 +592,17 @@
 
 	ANSWER_CHANNEL(chan_charlie);
 	EMULATE_APP_DATA(chan_charlie, 2, "Bridge", "");
+	do_sleep();
 	ast_bridge_impart(bridge, chan_charlie, NULL, NULL, 0);
 	do_sleep();
 	BRIDGE_TO_CONF(chan_alice, chan_bob, chan_charlie, bridge);
 
 	CONF_EXIT(chan_alice, bridge);
+	do_sleep();
 	CONF_EXIT(chan_bob, bridge);
+	do_sleep();
 	CONF_EXIT(chan_charlie, bridge);
+	do_sleep();
 
 	HANGUP_CHANNEL(chan_alice, AST_CAUSE_NORMAL, "");
 	HANGUP_CHANNEL(chan_bob, AST_CAUSE_NORMAL, "");
@@ -1044,21 +1030,32 @@
 	EMULATE_DIAL(chan_alice, CHANNEL_TECH_NAME "/Bob");
 
 	START_DIALED(chan_alice, chan_bob);
+	do_sleep();
 
 	CREATE_CHARLIE_CHANNEL(chan_charlie, &charlie_caller);
+	do_sleep();
 	EMULATE_DIAL(chan_charlie, CHANNEL_TECH_NAME "/Bob");
+	do_sleep();
 
 	START_DIALED_FULL(chan_charlie, chan_david, "400", "David");
 
 	ast_channel_state_set(chan_alice, AST_STATE_RINGING);
+	do_sleep();
 	ast_channel_state_set(chan_charlie, AST_STATE_RINGING);
+	do_sleep();
 	ast_channel_publish_dial(chan_alice, chan_bob, NULL, "ANSWER");
+	do_sleep();
 	ast_channel_publish_dial(chan_charlie, chan_david, NULL, "ANSWER");
+	do_sleep();
 
 	ANSWER_NO_APP(chan_alice);
+	do_sleep();
 	ANSWER_NO_APP(chan_bob);
+	do_sleep();
 	ANSWER_NO_APP(chan_charlie);
+	do_sleep();
 	ANSWER_NO_APP(chan_david);
+	do_sleep();
 
 	do_sleep();
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge, chan_charlie, NULL, NULL, 0));
@@ -1076,8 +1073,11 @@
 	CONF_ENTER_EVENT(chan_alice, bridge);
 
 	CONF_EXIT(chan_alice, bridge);
+	do_sleep();
 	CONF_EXIT(chan_bob, bridge);
+	do_sleep();
 	CONF_EXIT(chan_charlie, bridge);
+	do_sleep();
 	CONF_EXIT(chan_david, bridge);
 
 	HANGUP_CHANNEL(chan_alice, AST_CAUSE_NORMAL, "ANSWER");
@@ -1148,13 +1148,13 @@
 	RAII_VAR(struct ast_channel *, chan_alice, NULL, safe_channel_release);
 	RAII_VAR(struct ast_channel *, chan_bob, NULL, safe_channel_release);
 	RAII_VAR(struct ast_channel *, chan_charlie, NULL, safe_channel_release);
-	RAII_VAR(struct ast_channel *, chan_fred, NULL, safe_channel_release);
+	RAII_VAR(struct ast_channel *, chan_david, NULL, safe_channel_release);
 	RAII_VAR(struct ast_bridge *, bridge1, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_bridge *, bridge2, NULL, ao2_cleanup);
 	struct ast_party_caller alice_caller = ALICE_CALLERID;
 	struct ast_party_caller bob_caller = BOB_CALLERID;
 	struct ast_party_caller charlie_caller = CHARLIE_CALLERID;
-	struct ast_party_caller fred_caller = ALICE_CALLERID;
+	struct ast_party_caller david_caller = ALICE_CALLERID;
 
 	switch (cmd) {
 	case TEST_INIT:
@@ -1189,27 +1189,27 @@
 	bridge2 = ast_bridge_basic_new();
 	ast_test_validate(test, bridge2 != NULL);
 
-	CREATE_FRED_CHANNEL(chan_fred, &fred_caller);
+	CREATE_DAVID_CHANNEL(chan_david, &david_caller);
 	CREATE_CHARLIE_CHANNEL(chan_charlie, &charlie_caller);
-	ANSWER_NO_APP(chan_fred);
+	ANSWER_NO_APP(chan_david);
 	ANSWER_NO_APP(chan_charlie);
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_charlie, NULL, NULL, 0));
 	do_sleep();
 
-	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_fred, NULL, NULL, 0));
-	do_sleep();
-	APPEND_EVENT(chan_charlie, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_fred));
+	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_david, NULL, NULL, 0));
+	do_sleep();
+	APPEND_EVENT(chan_charlie, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_david));
 
 	/* Perform attended transfer */
 	APPEND_EVENT(chan_bob, AST_CEL_BRIDGE_END, NULL, NULL, ast_channel_name(chan_alice));
 
-	ast_bridge_transfer_attended(chan_alice, chan_fred);
-	do_sleep();
-	BRIDGE_TO_CONF(chan_charlie, chan_fred, chan_bob, bridge2);
-	CONF_EXIT_EVENT(chan_fred, bridge2);
-
-	ATTENDEDTRANSFER_BRIDGE(chan_alice, bridge1, chan_fred, bridge2);
+	ast_bridge_transfer_attended(chan_alice, chan_david);
+	do_sleep();
+	BRIDGE_TO_CONF(chan_charlie, chan_david, chan_bob, bridge2);
+	CONF_EXIT_EVENT(chan_david, bridge2);
+
+	ATTENDEDTRANSFER_BRIDGE(chan_alice, bridge1, chan_david, bridge2);
 
 	do_sleep();
 	CONF_EXIT(chan_bob, bridge2);
@@ -1221,7 +1221,7 @@
 	do_sleep();
 	HANGUP_CHANNEL(chan_bob, AST_CAUSE_NORMAL, "");
 	do_sleep();
-	HANGUP_CHANNEL(chan_fred, AST_CAUSE_NORMAL, "");
+	HANGUP_CHANNEL(chan_david, AST_CAUSE_NORMAL, "");
 	do_sleep();
 	HANGUP_CHANNEL(chan_charlie, AST_CAUSE_NORMAL, "");
 
@@ -1234,19 +1234,12 @@
 	RAII_VAR(struct ast_channel *, chan_bob, NULL, safe_channel_release);
 	RAII_VAR(struct ast_channel *, chan_charlie, NULL, safe_channel_release);
 	RAII_VAR(struct ast_channel *, chan_david, NULL, safe_channel_release);
-	RAII_VAR(struct ast_channel *, chan_eve, NULL, safe_channel_release);
-	RAII_VAR(struct ast_channel *, chan_fred, NULL, safe_channel_release);
 	RAII_VAR(struct ast_bridge *, bridge1, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_bridge *, bridge2, NULL, ao2_cleanup);
-	RAII_VAR(struct ast_channel_snapshot *, eve_tmp_snapshot, NULL, ao2_cleanup);
 	struct ast_party_caller alice_caller = ALICE_CALLERID;
 	struct ast_party_caller bob_caller = BOB_CALLERID;
 	struct ast_party_caller charlie_caller = CHARLIE_CALLERID;
-	struct ast_party_caller david_caller = DAVID_CALLERID;
-	struct ast_party_caller eve_caller = EVE_CALLERID;
-	struct ast_party_caller fred_caller = EVE_CALLERID;
-	struct ast_bridge_channel_pair transferee;
-	struct ast_bridge_channel_pair target;
+	struct ast_party_caller david_caller = ALICE_CALLERID;
 
 	switch (cmd) {
 	case TEST_INIT:
@@ -1255,7 +1248,7 @@
 		info->summary = "Test attended transfers between two pairs of"
 			" bridged parties that results in a bridge merge";
 		info->description =
-			"This test creates six channels, places each triplet"
+			"This test creates four channels, places each pair"
 			" in a bridge, and then attended transfers the bridges"
 			" together causing a bridge merge.\n";
 		return AST_TEST_NOT_RUN;
@@ -1263,99 +1256,62 @@
 		break;
 	}
 	/* Create first set of bridged parties */
-	bridge1 = ast_bridge_basic_new();
+	bridge1 = ast_bridge_base_new(AST_BRIDGE_CAPABILITY_1TO1MIX | AST_BRIDGE_CAPABILITY_NATIVE | AST_BRIDGE_CAPABILITY_MULTIMIX,
+		AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM | AST_BRIDGE_FLAG_TRANSFER_PROHIBITED | AST_BRIDGE_FLAG_SMART);
 	ast_test_validate(test, bridge1 != NULL);
 
 	CREATE_ALICE_CHANNEL(chan_alice, &alice_caller);
 	CREATE_BOB_CHANNEL(chan_bob, &bob_caller);
-	CREATE_DAVID_CHANNEL(chan_david, &david_caller);
 	ANSWER_NO_APP(chan_alice);
 	ANSWER_NO_APP(chan_bob);
+
+	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_bob, NULL, NULL, 0));
+	do_sleep();
+
+	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_alice, NULL, NULL, 0));
+	do_sleep();
+	APPEND_EVENT(chan_bob, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_alice));
+
+	/* Create second set of bridged parties */
+	bridge2 = ast_bridge_base_new(AST_BRIDGE_CAPABILITY_1TO1MIX | AST_BRIDGE_CAPABILITY_NATIVE | AST_BRIDGE_CAPABILITY_MULTIMIX,
+		AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM | AST_BRIDGE_FLAG_TRANSFER_PROHIBITED | AST_BRIDGE_FLAG_SMART);
+	ast_test_validate(test, bridge2 != NULL);
+
+	CREATE_DAVID_CHANNEL(chan_david, &david_caller);
+	CREATE_CHARLIE_CHANNEL(chan_charlie, &charlie_caller);
 	ANSWER_NO_APP(chan_david);
-
-	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_bob, NULL, NULL, 0));
-	do_sleep();
-
-	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_alice, NULL, NULL, 0));
-	do_sleep();
-	APPEND_EVENT(chan_bob, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_alice));
-
-	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_david, NULL, NULL, 0));
-	do_sleep();
-	BRIDGE_TO_CONF(chan_bob, chan_alice, chan_david, bridge1);
-
-	/* Create second set of bridged parties */
-	bridge2 = ast_bridge_basic_new();
-	ast_test_validate(test, bridge2 != NULL);
-
-	CREATE_FRED_CHANNEL(chan_fred, &fred_caller);
-	CREATE_CHARLIE_CHANNEL(chan_charlie, &charlie_caller);
-	CREATE_EVE_CHANNEL(chan_eve, &eve_caller);
-	ANSWER_NO_APP(chan_fred);
 	ANSWER_NO_APP(chan_charlie);
-	ANSWER_NO_APP(chan_eve);
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_charlie, NULL, NULL, 0));
 	do_sleep();
 
-	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_fred, NULL, NULL, 0));
-	do_sleep();
-	APPEND_EVENT(chan_charlie, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_fred));
-
-	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_eve, NULL, NULL, 0));
-	do_sleep();
-	BRIDGE_TO_CONF(chan_charlie, chan_fred, chan_eve, bridge2);
-	do_sleep();
+	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_david, NULL, NULL, 0));
+	do_sleep();
+	APPEND_EVENT(chan_charlie, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_david));
 
 	/* Perform attended transfer */
-	CONF_EXIT(chan_eve, bridge2);
-	do_sleep();
-	CONF_EXIT_EVENT(chan_charlie, bridge2);
-	do_sleep();
-	ast_test_validate(test, 0 == ast_bridge_depart(chan_charlie)); \
-	do_sleep();
-	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_charlie, NULL, NULL, 0)); \
-	do_sleep();
-	CONF_ENTER_EVENT(chan_charlie, bridge1); \
-	do_sleep();
-	CONF_EXIT_EVENT(chan_charlie, bridge1);
-
-	/* Fred goes away */
-	CONF_EXIT(chan_fred, bridge2);
-	do_sleep();
-	/*CONF_EXIT_EVENT(chan_eve, bridge1);
-	do_sleep();
-	ast_test_validate(test, 0 == ast_bridge_depart(chan_eve)); \
-	do_sleep();*/
-
-	/* Alice goes away */
-	CONF_EXIT(chan_alice, bridge1);
-	do_sleep();
-
-	transferee.bridge = bridge1;
-	transferee.channel = chan_alice;
-	target.bridge = bridge2;
-	target.channel = chan_fred;
-	ast_bridge_publish_attended_transfer_bridge_merge(1, AST_BRIDGE_TRANSFER_SUCCESS,
-		&transferee, &target, bridge1);
-	ATTENDEDTRANSFER_BRIDGE(chan_alice, bridge1, chan_fred, bridge2);
-
+	APPEND_EVENT(chan_charlie, AST_CEL_BRIDGE_END, NULL, NULL, ast_channel_name(chan_david));
+
+	ast_bridge_transfer_attended(chan_alice, chan_david);
+	do_sleep();
+	BRIDGE_TO_CONF(chan_bob, chan_alice, chan_charlie, bridge1);
+	CONF_EXIT_EVENT(chan_alice, bridge1);
+
+	ATTENDEDTRANSFER_BRIDGE(chan_alice, bridge1, chan_david, bridge2);
+
+	do_sleep();
 	CONF_EXIT(chan_bob, bridge1);
 	do_sleep();
-	CONF_EXIT(chan_david, bridge1);
-	do_sleep();
-
-	HANGUP_CHANNEL(chan_fred, AST_CAUSE_NORMAL, "");
+	CONF_EXIT(chan_charlie, bridge1);
+
 	do_sleep();
 	HANGUP_CHANNEL(chan_alice, AST_CAUSE_NORMAL, "");
 	do_sleep();
 	HANGUP_CHANNEL(chan_bob, AST_CAUSE_NORMAL, "");
 	do_sleep();
+	HANGUP_CHANNEL(chan_david, AST_CAUSE_NORMAL, "");
+	do_sleep();
 	HANGUP_CHANNEL(chan_charlie, AST_CAUSE_NORMAL, "");
-	do_sleep();
-	HANGUP_CHANNEL(chan_david, AST_CAUSE_NORMAL, "");
-	do_sleep();
-	HANGUP_CHANNEL(chan_eve, AST_CAUSE_NORMAL, "");
 
 	return AST_TEST_PASS;
 }
@@ -1366,17 +1322,12 @@
 	RAII_VAR(struct ast_channel *, chan_bob, NULL, safe_channel_release);
 	RAII_VAR(struct ast_channel *, chan_charlie, NULL, safe_channel_release);
 	RAII_VAR(struct ast_channel *, chan_david, NULL, safe_channel_release);
-	RAII_VAR(struct ast_channel *, chan_eve, NULL, safe_channel_release);
-	RAII_VAR(struct ast_channel *, chan_fred, NULL, safe_channel_release);
 	RAII_VAR(struct ast_bridge *, bridge1, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_bridge *, bridge2, NULL, ao2_cleanup);
-	RAII_VAR(struct ast_channel_snapshot *, eve_tmp_snapshot, NULL, ao2_cleanup);
 	struct ast_party_caller alice_caller = ALICE_CALLERID;
 	struct ast_party_caller bob_caller = BOB_CALLERID;
 	struct ast_party_caller charlie_caller = CHARLIE_CALLERID;
-	struct ast_party_caller david_caller = DAVID_CALLERID;
-	struct ast_party_caller eve_caller = EVE_CALLERID;
-	struct ast_party_caller fred_caller = EVE_CALLERID;
+	struct ast_party_caller david_caller = ALICE_CALLERID;
 
 	switch (cmd) {
 	case TEST_INIT:
@@ -1385,9 +1336,9 @@
 		info->summary = "Test attended transfers between two pairs of"
 			" bridged parties that results in a bridge merge";
 		info->description =
-			"This test creates six channels, places each triplet"
+			"This test creates four channels, places each pair"
 			" in a bridge, and then attended transfers the bridges"
-			" together causing a bridge merge.\n";
+			" together causing a bridge link.\n";
 		return AST_TEST_NOT_RUN;
 	case TEST_EXECUTE:
 		break;
@@ -1395,97 +1346,83 @@
 	/* Create first set of bridged parties */
 	bridge1 = ast_bridge_base_new(AST_BRIDGE_CAPABILITY_1TO1MIX | AST_BRIDGE_CAPABILITY_NATIVE | AST_BRIDGE_CAPABILITY_MULTIMIX,
 		AST_BRIDGE_FLAG_MERGE_INHIBIT_TO | AST_BRIDGE_FLAG_MERGE_INHIBIT_FROM
-		| AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM | AST_BRIDGE_FLAG_TRANSFER_PROHIBITED | AST_BRIDGE_FLAG_SMART);
+		| AST_BRIDGE_FLAG_SWAP_INHIBIT_TO | AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM
+		| AST_BRIDGE_FLAG_TRANSFER_PROHIBITED | AST_BRIDGE_FLAG_SMART);
 	ast_test_validate(test, bridge1 != NULL);
 
 	CREATE_ALICE_CHANNEL(chan_alice, &alice_caller);
 	CREATE_BOB_CHANNEL(chan_bob, &bob_caller);
-	CREATE_DAVID_CHANNEL(chan_david, &david_caller);
 	ANSWER_NO_APP(chan_alice);
 	ANSWER_NO_APP(chan_bob);
+
+	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_bob, NULL, NULL, 0));
+	do_sleep();
+
+	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_alice, NULL, NULL, 0));
+	do_sleep();
+	APPEND_EVENT(chan_bob, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_alice));
+
+	/* Create second set of bridged parties */
+	bridge2 = ast_bridge_base_new(AST_BRIDGE_CAPABILITY_1TO1MIX | AST_BRIDGE_CAPABILITY_NATIVE | AST_BRIDGE_CAPABILITY_MULTIMIX,
+		AST_BRIDGE_FLAG_MERGE_INHIBIT_TO | AST_BRIDGE_FLAG_MERGE_INHIBIT_FROM
+		| AST_BRIDGE_FLAG_SWAP_INHIBIT_TO | AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM
+		| AST_BRIDGE_FLAG_TRANSFER_PROHIBITED | AST_BRIDGE_FLAG_SMART);
+	ast_test_validate(test, bridge2 != NULL);
+
+	CREATE_DAVID_CHANNEL(chan_david, &david_caller);
+	CREATE_CHARLIE_CHANNEL(chan_charlie, &charlie_caller);
 	ANSWER_NO_APP(chan_david);
-
-	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_bob, NULL, NULL, 0));
-	do_sleep();
-
-	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_alice, NULL, NULL, 0));
-	do_sleep();
-	APPEND_EVENT(chan_bob, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_alice));
-
-	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_david, NULL, NULL, 0));
-	do_sleep();
-	BRIDGE_TO_CONF(chan_bob, chan_alice, chan_david, bridge1);
-
-	/* Create second set of bridged parties */
-	bridge2 = ast_bridge_basic_new();
-	ast_test_validate(test, bridge2 != NULL);
-
-	CREATE_FRED_CHANNEL(chan_fred, &fred_caller);
-	CREATE_CHARLIE_CHANNEL(chan_charlie, &charlie_caller);
-	CREATE_EVE_CHANNEL(chan_eve, &eve_caller);
-	ANSWER_NO_APP(chan_fred);
 	ANSWER_NO_APP(chan_charlie);
-	ANSWER_NO_APP(chan_eve);
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_charlie, NULL, NULL, 0));
 	do_sleep();
 
-	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_fred, NULL, NULL, 0));
-	do_sleep();
-	APPEND_EVENT(chan_charlie, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_fred));
-
-	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_eve, NULL, NULL, 0));
-	do_sleep();
-	BRIDGE_TO_CONF(chan_charlie, chan_fred, chan_eve, bridge2);
+	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_david, NULL, NULL, 0));
+	do_sleep();
+	APPEND_EVENT(chan_charlie, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_david));
 
 	/* Perform attended transfer */
-	ast_bridge_transfer_attended(chan_alice, chan_fred);
-	do_sleep();
-
-	/* Append dummy event for the link channel ;1 start */
-	APPEND_DUMMY_EVENT();
-
-	/* Append dummy event for the link channel ;2 start */
-	APPEND_DUMMY_EVENT();
-
-	/* Append dummy event for the link channel ;2 answer */
-	APPEND_DUMMY_EVENT();
-
-	ATTENDEDTRANSFER_BRIDGE(chan_alice, bridge1, chan_fred, bridge2);
-
-	/* Append dummy event for the link channel ;1 enter */
-	APPEND_DUMMY_EVENT();
-
-	/* Append dummy events for the link channel ;2 enter and Alice's exit,
-	 * must both be dummies since they're racing */
+
+	/* The following events can not be matched directly since nothing is known
+	 * about the linking local channel.
+	 * local channel ;1 and ;2 creation and ;2 answer */
 	APPEND_DUMMY_EVENT();
 	APPEND_DUMMY_EVENT();
-
-	/* Append dummy events for the link channel ;1 answer and Fred's exit,
-	 * must both be dummies since they're racing */
+	APPEND_DUMMY_EVENT();
+
+	ATTENDEDTRANSFER_BRIDGE(chan_alice, bridge1, chan_david, bridge2);
+
+	/* The two BRIDGE_TO_CONFs and CONF_EXITs are all racing to be first */
+
+	/* BRIDGE_TO_CONF with primary charlie, peer david, and trigger channel ;2 */
+	APPEND_DUMMY_EVENT();
+
+	ast_bridge_transfer_attended(chan_alice, chan_david);
+	do_sleep();
+
+	/* BRIDGE_TO_CONF with primary bob, peer alice, and trigger channel ;1 */
+	APPEND_DUMMY_EVENT();
+
+	/* CONF_EXIT alice and david */
 	APPEND_DUMMY_EVENT();
 	APPEND_DUMMY_EVENT();
 
+	/* ANSWER ;1 */
+	APPEND_DUMMY_EVENT();
+
+	do_sleep();
 	CONF_EXIT(chan_bob, bridge1);
 	do_sleep();
 	CONF_EXIT(chan_charlie, bridge2);
-	do_sleep();
-	CONF_EXIT(chan_david, bridge1);
-	do_sleep();
-	CONF_EXIT(chan_eve, bridge2);
 
 	do_sleep();
 	HANGUP_CHANNEL(chan_alice, AST_CAUSE_NORMAL, "");
 	do_sleep();
 	HANGUP_CHANNEL(chan_bob, AST_CAUSE_NORMAL, "");
 	do_sleep();
-	HANGUP_CHANNEL(chan_fred, AST_CAUSE_NORMAL, "");
+	HANGUP_CHANNEL(chan_david, AST_CAUSE_NORMAL, "");
 	do_sleep();
 	HANGUP_CHANNEL(chan_charlie, AST_CAUSE_NORMAL, "");
-	do_sleep();
-	HANGUP_CHANNEL(chan_david, AST_CAUSE_NORMAL, "");
-	do_sleep();
-	HANGUP_CHANNEL(chan_eve, AST_CAUSE_NORMAL, "");
 
 	return AST_TEST_PASS;
 }
@@ -1776,7 +1713,7 @@
 	return 0;
 }
 
-static int events_are_equal(struct ast_event *received, struct ast_event *expected)
+static int events_are_equal(struct ast_test *test, struct ast_event *received, struct ast_event *expected)
 {
 	struct ast_event_iterator iterator;
 	int res;
@@ -1794,7 +1731,7 @@
 			&& ie_type != AST_EVENT_IE_EID
 			&& ie_type != AST_EVENT_IE_CEL_EVENT_TIME
 			&& !match_ie_val(received, expected, ie_type)) {
-			ast_log(LOG_ERROR, "Failed matching on field %s\n", ast_event_get_ie_type_name(ie_type));
+			ast_test_status_update(test, "Failed matching on field %s\n", ast_event_get_ie_type_name(ie_type));
 			return 0;
 		}
 	}
@@ -1802,16 +1739,16 @@
 	return 1;
 }
 
-static int dump_event(struct ast_event *event)
+static int dump_event(struct ast_test *test, struct ast_event *event)
 {
 	struct ast_event_iterator i;
 
 	if (ast_event_iterator_init(&i, event)) {
-		ast_log(LOG_ERROR, "Failed to initialize event iterator.  :-(\n");
+		ast_test_status_update(test, "Failed to initialize event iterator.  :-(\n");
 		return 0;
 	}
 
-	ast_log(LOG_ERROR, "Event: %s %s\n", ast_event_get_type_name(event),
+	ast_test_status_update(test, "Event: %s %s\n", ast_event_get_type_name(event),
 		ast_cel_get_type_name(ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE)));
 
 	do {
@@ -1826,37 +1763,37 @@
 		switch (ie_pltype) {
 		case AST_EVENT_IE_PLTYPE_UNKNOWN:
 		case AST_EVENT_IE_PLTYPE_EXISTS:
-			ast_log(LOG_ERROR, "%s\n", ie_type_name);
+			ast_test_status_update(test, "%s\n", ie_type_name);
 			break;
 		case AST_EVENT_IE_PLTYPE_STR:
-			ast_log(LOG_ERROR, "%.30s: %s\n", ie_type_name,
+			ast_test_status_update(test, "%.30s: %s\n", ie_type_name,
 					ast_event_iterator_get_ie_str(&i));
 			break;
 		case AST_EVENT_IE_PLTYPE_UINT:
-			ast_log(LOG_ERROR, "%.30s: %u\n", ie_type_name,
+			ast_test_status_update(test, "%.30s: %u\n", ie_type_name,
 					ast_event_iterator_get_ie_uint(&i));
 			break;
 		case AST_EVENT_IE_PLTYPE_BITFLAGS:
-			ast_log(LOG_ERROR, "%.30s: %u\n", ie_type_name,
+			ast_test_status_update(test, "%.30s: %u\n", ie_type_name,
 					ast_event_iterator_get_ie_bitflags(&i));
 		default:
 			break;
 		}
 	} while (!ast_event_iterator_next(&i));
 
-	ast_log(LOG_ERROR, "\n");
+	ast_test_status_update(test, "\n");
 
 	return 0;
 }
 
-static int check_events(struct ao2_container *local_expected, struct ao2_container *local_received)
+static int check_events(struct ast_test *test, struct ao2_container *local_expected, struct ao2_container *local_received)
 {
 	struct ao2_iterator expected_it, received_it;
 	struct ast_event *rx_event, *ex_event;
 	int debug = 0;
 
 	if (ao2_container_count(local_expected) != ao2_container_count(local_received)) {
-		ast_log(LOG_ERROR, "Increasing verbosity since the number of expected events (%d)"
+		ast_test_status_update(test, "Increasing verbosity since the number of expected events (%d)"
 			" did not match number of received events (%d).\n",
 			ao2_container_count(local_expected),
 			ao2_container_count(local_received));
@@ -1868,16 +1805,16 @@
 	rx_event = ao2_iterator_next(&received_it);
 	ex_event = ao2_iterator_next(&expected_it);
 	while (rx_event && ex_event) {
-		if (!events_are_equal(rx_event, ex_event)) {
-			ast_log(LOG_ERROR, "Received event:\n");
-			dump_event(rx_event);
-			ast_log(LOG_ERROR, "Expected event:\n");
-			dump_event(ex_event);
+		if (!events_are_equal(test, rx_event, ex_event)) {
+			ast_test_status_update(test, "Received event:\n");
+			dump_event(test, rx_event);
+			ast_test_status_update(test, "Expected event:\n");
+			dump_event(test, ex_event);
 			return -1;
 		}
 		if (debug) {
-			ast_log(LOG_ERROR, "Compared events successfully%s\n", ast_event_get_type(ex_event) == AST_EVENT_CUSTOM ? " (wildcard match)" : "");
-			dump_event(rx_event);
+			ast_test_status_update(test, "Compared events successfully%s\n", ast_event_get_type(ex_event) == AST_EVENT_CUSTOM ? " (wildcard match)" : "");
+			dump_event(test, rx_event);
 		}
 		ao2_cleanup(rx_event);
 		ao2_cleanup(ex_event);
@@ -1886,14 +1823,14 @@
 	}
 
 	if (rx_event) {
-		ast_log(LOG_ERROR, "Received event:\n");
-		dump_event(rx_event);
+		ast_test_status_update(test, "Received event:\n");
+		dump_event(test, rx_event);
 		ao2_cleanup(rx_event);
 		return -1;
 	}
 	if (ex_event) {
-		ast_log(LOG_ERROR, "Expected event:\n");
-		dump_event(ex_event);
+		ast_test_status_update(test, "Expected event:\n");
+		dump_event(test, ex_event);
 		ao2_cleanup(ex_event);
 		return -1;
 	}
@@ -1966,7 +1903,7 @@
 	cel_received_events = NULL;
 
 	/* check events */
-	ast_test_validate(test, !check_events(local_expected, local_received));
+	ast_test_validate(test, !check_events(test, local_expected, local_received));
 
 	/* Restore the real CEL config */
 	ast_cel_set_config(saved_config);




More information about the asterisk-commits mailing list