OCF_HANGUP = (1 << 0)
} opaque_channel_flag_t;
+typedef enum {
+ LP_NEITHER,
+ LP_ORIGINATOR,
+ LP_ORIGINATEE
+} switch_originator_type_t;
+
struct switch_channel {
char *name;
switch_call_direction_t direction;
int event_count;
int profile_index;
opaque_channel_flag_t opaque_flags;
+ switch_originator_type_t last_profile_type;
};
switch_caller_profile_event_set_data(caller_profile, "Caller", event);
}
- if (originator_caller_profile && originatee_caller_profile) {
- /* Index Originator's Profile */
- switch_caller_profile_event_set_data(originator_caller_profile, "Originator", event);
-
- /* Index Originatee's Profile */
- switch_caller_profile_event_set_data(originatee_caller_profile, "Originatee", event);
- } else {
- /* Index Originator's Profile */
- if (originator_caller_profile) {
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Other-Type", "originator");
- switch_caller_profile_event_set_data(originator_caller_profile, "Other-Leg", event);
- } else if (originatee_caller_profile) { /* Index Originatee's Profile */
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Other-Type", "originatee");
- switch_caller_profile_event_set_data(originatee_caller_profile, "Other-Leg", event);
- }
+ /* Index Originator/ee's Profile */
+ if (originator_caller_profile && channel->last_profile_type == LP_ORIGINATOR) {
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Other-Type", "originator");
+ switch_caller_profile_event_set_data(originator_caller_profile, "Other-Leg", event);
+ } else if (originatee_caller_profile && channel->last_profile_type == LP_ORIGINATEE) { /* Index Originatee's Profile */
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Other-Type", "originatee");
+ switch_caller_profile_event_set_data(originatee_caller_profile, "Other-Leg", event);
}
+
switch_mutex_unlock(channel->profile_mutex);
}
if (channel->caller_profile) {
caller_profile->next = channel->caller_profile->originator_caller_profile;
channel->caller_profile->originator_caller_profile = caller_profile;
+ channel->last_profile_type = LP_ORIGINATOR;
}
switch_assert(channel->caller_profile->originator_caller_profile->next != channel->caller_profile->originator_caller_profile);
switch_mutex_unlock(channel->profile_mutex);
if (channel->caller_profile) {
caller_profile->next = channel->caller_profile->originatee_caller_profile;
channel->caller_profile->originatee_caller_profile = caller_profile;
+ channel->last_profile_type = LP_ORIGINATEE;
}
switch_assert(channel->caller_profile->originatee_caller_profile->next != channel->caller_profile->originatee_caller_profile);
switch_mutex_unlock(channel->profile_mutex);
if (switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) {
switch_channel_clear_flag_recursive(channel, CF_BRIDGE_ORIGINATOR);
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_UNBRIDGE) == SWITCH_STATUS_SUCCESS) {
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(session));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", uuid);
switch_channel_event_set_data(channel, event);
switch_event_fire(&event);
}
switch_channel_set_variable(peer_channel, "call_uuid", switch_core_session_get_uuid(peer_session));
if (br && switch_event_create(&event, SWITCH_EVENT_CHANNEL_UNBRIDGE) == SWITCH_STATUS_SUCCESS) {
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(session));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", switch_core_session_get_uuid(peer_session));
switch_channel_event_set_data(caller_channel, event);
switch_event_fire(&event);
}