mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
app_confbridge: Attended transfer event fixup
When a channel already in a conference bridge is attended transfered to another extension, or when an existing call is attended transferred into a conference bridge, we now generate ConfbridgeJoin and ConfbridgeLeave events for the entering and departing channels. Change-Id: Id7709cfbceb26fbcb828b2d0d2a6b2fbeaf028e1
This commit is contained in:
@@ -621,6 +621,26 @@ static void confbridge_join_cb(void *data, struct stasis_subscription *sub,
|
||||
ast_free(extra_text);
|
||||
}
|
||||
|
||||
static void confbridge_atxfer_cb(void *data, struct stasis_subscription *sub,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
struct ast_attended_transfer_message *msg = stasis_message_data(message);
|
||||
|
||||
if (msg->result != AST_BRIDGE_TRANSFER_SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* This callback will get called for ALL attended transfers
|
||||
* so we need to make sure this transfer belongs to
|
||||
* a conference bridge before trying to handle it.
|
||||
*/
|
||||
if (msg->dest_type == AST_ATTENDED_TRANSFER_DEST_APP
|
||||
&& strcmp(msg->dest.app, "ConfBridge") == 0) {
|
||||
confbridge_handle_atxfer(msg);
|
||||
}
|
||||
}
|
||||
|
||||
static void confbridge_start_record_cb(void *data, struct stasis_subscription *sub,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
@@ -739,6 +759,13 @@ int manager_confbridge_init(void)
|
||||
manager_confbridge_shutdown();
|
||||
return -1;
|
||||
}
|
||||
if (stasis_message_router_add(bridge_state_router,
|
||||
ast_attended_transfer_type(),
|
||||
confbridge_atxfer_cb,
|
||||
NULL)) {
|
||||
manager_confbridge_shutdown();
|
||||
return -1;
|
||||
}
|
||||
if (stasis_message_router_add(bridge_state_router,
|
||||
confbridge_leave_type(),
|
||||
confbridge_leave_cb,
|
||||
|
Reference in New Issue
Block a user