endless cid fun

This commit is contained in:
Anthony Minessale 2013-04-05 08:28:49 -05:00
parent 11cda996a8
commit 83fc8ddf3a
5 changed files with 28 additions and 19 deletions

View File

@ -335,7 +335,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_caller_extension_masquerade(switc
SWITCH_DECLARE(void) switch_channel_set_caller_extension(switch_channel_t *channel, switch_caller_extension_t *caller_extension);
SWITCH_DECLARE(void) switch_channel_flip_cid(switch_channel_t *channel);
SWITCH_DECLARE(void) switch_channel_sort_cid(switch_channel_t *channel, switch_bool_t in);
SWITCH_DECLARE(void) switch_channel_sort_cid(switch_channel_t *channel);
/*!
\brief Retrieve caller extension from a given channel

View File

@ -1253,6 +1253,7 @@ typedef enum {
CF_JITTERBUFFER,
CF_JITTERBUFFER_PLC,
CF_DIALPLAN,
CF_BLEG,
CF_BLOCK_BROADCAST_UNTIL_MEDIA,
CF_CNG_PLC,
CF_ATTENDED_TRANSFER,

View File

@ -2997,6 +2997,10 @@ SWITCH_STANDARD_APP(fifo_function)
originatee_cp->callee_id_name = tname;
originatee_cp->callee_id_number = tnum;
if (switch_channel_direction(other_channel) == SWITCH_CALL_DIRECTION_INBOUND) {
switch_channel_set_flag(other_channel, CF_BLEG);
}
}

View File

@ -2891,26 +2891,16 @@ SWITCH_DECLARE(void) switch_channel_flip_cid(switch_channel_t *channel)
}
SWITCH_DECLARE(void) switch_channel_sort_cid(switch_channel_t *channel, switch_bool_t in)
SWITCH_DECLARE(void) switch_channel_sort_cid(switch_channel_t *channel)
{
if (in) {
if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND && !switch_channel_test_flag(channel, CF_DIALPLAN)) {
switch_channel_set_flag(channel, CF_DIALPLAN);
switch_channel_flip_cid(channel);
}
return;
if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND && switch_channel_test_flag(channel, CF_BLEG)) {
switch_channel_flip_cid(channel);
switch_channel_clear_flag(channel, CF_BLEG);
} else if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND && !switch_channel_test_flag(channel, CF_DIALPLAN)) {
switch_channel_set_flag(channel, CF_DIALPLAN);
switch_channel_flip_cid(channel);
}
if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND && switch_channel_test_flag(channel, CF_DIALPLAN)) {
switch_channel_clear_flag(channel, CF_DIALPLAN);
switch_mutex_lock(channel->profile_mutex);
channel->caller_profile->callee_id_name = SWITCH_BLANK_STRING;
channel->caller_profile->callee_id_number = SWITCH_BLANK_STRING;
switch_mutex_unlock(channel->profile_mutex);
}
}
SWITCH_DECLARE(switch_caller_extension_t *) switch_channel_get_queued_extension(switch_channel_t *channel)
@ -2939,7 +2929,7 @@ SWITCH_DECLARE(void) switch_channel_set_caller_extension(switch_channel_t *chann
{
switch_assert(channel != NULL);
switch_channel_sort_cid(channel, SWITCH_TRUE);
switch_channel_sort_cid(channel);
switch_mutex_lock(channel->profile_mutex);
caller_extension->next = channel->caller_profile->caller_extension;

View File

@ -1124,6 +1124,15 @@ static const switch_state_handler_table_t signal_bridge_state_handlers = {
static void check_bridge_export(switch_channel_t *channel, switch_channel_t *peer_channel)
{
switch_caller_profile_t *originator_cp, *originatee_cp;
originator_cp = switch_channel_get_caller_profile(channel);
originatee_cp = switch_channel_get_caller_profile(peer_channel);
originator_cp->callee_id_name = switch_core_strdup(originator_cp->pool, originatee_cp->callee_id_name);
originator_cp->callee_id_number = switch_core_strdup(originator_cp->pool, originatee_cp->callee_id_number);
switch_channel_process_export(peer_channel, channel, NULL, SWITCH_BRIDGE_EXPORT_VARS_VARIABLE);
switch_channel_process_export(channel, peer_channel, NULL, SWITCH_BRIDGE_EXPORT_VARS_VARIABLE);
}
@ -1656,6 +1665,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uu
originatee_cp->callee_id_name = tname;
originatee_cp->callee_id_number = tnum;
if (switch_channel_direction(originatee_channel) == SWITCH_CALL_DIRECTION_INBOUND) {
switch_channel_set_flag(originatee_channel, CF_BLEG);
}
}