diff options
author | Kinsey Moore <kmoore@digium.com> | 2014-08-20 13:06:33 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2014-08-20 13:06:33 +0000 |
commit | 36f4bff943c0ea83b3d1a3ab5243658d64b16ba3 (patch) | |
tree | 7bc49bbdb265bfae3c007c1b23f9964c202ae5f9 /res/stasis | |
parent | 01f1ff1f77101b2612ddb885dc6e22125e46a9fb (diff) |
Stasis: Add information to blind transfer event
When a blind transfer occurs that is forced to create a local channel
pair to satisfy the transfer request, information about the local
channel pair is not published. This adds a field to describe that
channel to the blind transfer message struct so that this information
is conveyed properly to consumers of the blind transfer message.
This also fixes a bug in which Stasis() was unable to properly identify
the channel that was replacing an existing Stasis-controlled channel
due to a blind transfer.
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3921/
........
Merged revisions 421537 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 421538 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/stasis')
-rw-r--r-- | res/stasis/app.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/res/stasis/app.c b/res/stasis/app.c index 245936734..9440cf1bd 100644 --- a/res/stasis/app.c +++ b/res/stasis/app.c @@ -696,19 +696,6 @@ static int bridge_app_subscribed_involved(struct stasis_app *app, struct ast_bri return subscribed; } -static void bridge_blind_transfer_handler(void *data, struct stasis_subscription *sub, - struct stasis_message *message) -{ - struct stasis_app *app = data; - struct ast_blind_transfer_message *transfer_msg = stasis_message_data(message); - struct ast_bridge_snapshot *bridge = transfer_msg->to_transferee.bridge_snapshot; - - if (bridge_app_subscribed(app, transfer_msg->to_transferee.channel_snapshot->uniqueid) || - (bridge && bridge_app_subscribed_involved(app, bridge))) { - stasis_publish(app->topic, message); - } -} - static void set_replacement_channel(struct ast_channel_snapshot *to_be_replaced, struct ast_channel_snapshot *replacing) { @@ -726,6 +713,24 @@ static void set_replacement_channel(struct ast_channel_snapshot *to_be_replaced, ao2_cleanup(control); } +static void bridge_blind_transfer_handler(void *data, struct stasis_subscription *sub, + struct stasis_message *message) +{ + struct stasis_app *app = data; + struct ast_blind_transfer_message *transfer_msg = stasis_message_data(message); + struct ast_bridge_snapshot *bridge = transfer_msg->to_transferee.bridge_snapshot; + + if (transfer_msg->replace_channel) { + set_replacement_channel(transfer_msg->to_transferee.channel_snapshot, + transfer_msg->replace_channel); + } + + if (bridge_app_subscribed(app, transfer_msg->to_transferee.channel_snapshot->uniqueid) || + (bridge && bridge_app_subscribed_involved(app, bridge))) { + stasis_publish(app->topic, message); + } +} + static void bridge_attended_transfer_handler(void *data, struct stasis_subscription *sub, struct stasis_message *message) { |