[asterisk-commits] mjordan: branch 12 r428104 - /branches/12/tests/test_cel.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Nov 17 09:15:38 CST 2014
Author: mjordan
Date: Mon Nov 17 09:15:30 2014
New Revision: 428104
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=428104
Log:
tests/test_cel: Fix CEL unit tests
This is a backport of the test_cel portion of r427870, which was not applied to
the 12 branch. This fixes the compilation issues with the CEL unit tests
introduced by the API changes needed to fix publication of blind transfer
messages.
Modified:
branches/12/tests/test_cel.c
Modified: branches/12/tests/test_cel.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/tests/test_cel.c?view=diff&rev=428104&r1=428103&r2=428104
==============================================================================
--- branches/12/tests/test_cel.c (original)
+++ branches/12/tests/test_cel.c Mon Nov 17 09:15:30 2014
@@ -1224,9 +1224,9 @@
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_bridge *, bridge, NULL, safe_bridge_destroy);
+ RAII_VAR(struct ast_blind_transfer_message *, transfer_msg, NULL, ao2_cleanup);
struct ast_party_caller alice_caller = ALICE_CALLERID;
struct ast_party_caller bob_caller = BOB_CALLERID;
- struct ast_bridge_channel_pair pair;
switch (cmd) {
case TEST_INIT:
@@ -1252,12 +1252,21 @@
BRIDGE_ENTER(chan_bob, bridge);
BRIDGE_ENTER(chan_alice, bridge);
- pair.bridge = bridge;
- pair.channel = chan_alice;
ast_bridge_lock(bridge);
- ast_bridge_publish_blind_transfer(1, AST_BRIDGE_TRANSFER_SUCCESS,
- &pair, "transfer_context", "transfer_extension", NULL, NULL);
+ transfer_msg = ast_blind_transfer_message_create(1, chan_alice,
+ "transfer_extension", "transfer_context");
+ if (!transfer_msg) {
+ ast_test_status_update(test, "Failed to create transfer Stasis message\n");
+ return AST_TEST_FAIL;
+ }
+ transfer_msg->bridge = ast_bridge_snapshot_create(bridge);
+ if (!transfer_msg->bridge) {
+ ast_test_status_update(test, "Failed to create bridge snapshot\n");
+ return AST_TEST_FAIL;
+ }
ast_bridge_unlock(bridge);
+ transfer_msg->result = AST_BRIDGE_TRANSFER_SUCCESS;
+ ast_bridge_publish_blind_transfer(transfer_msg);
BLINDTRANSFER_EVENT(chan_alice, bridge, "transfer_extension", "transfer_context");
BRIDGE_EXIT(chan_alice, bridge);
More information about the asterisk-commits
mailing list