提交 e17a6145 authored 作者: Anthony Minessale's avatar Anthony Minessale

part 2 of other cid patch

上级 7adad5ae
...@@ -603,6 +603,7 @@ SWITCH_DECLARE(void) switch_channel_event_set_extended_data(_In_ switch_channel_ ...@@ -603,6 +603,7 @@ SWITCH_DECLARE(void) switch_channel_event_set_extended_data(_In_ switch_channel_
SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *channel, const char *in, switch_event_t *var_list, switch_event_t *api_list, uint32_t recur); SWITCH_DECLARE(char *) switch_channel_expand_variables_check(switch_channel_t *channel, const char *in, switch_event_t *var_list, switch_event_t *api_list, uint32_t recur);
#define switch_channel_expand_variables(_channel, _in) switch_channel_expand_variables_check(_channel, _in, NULL, NULL, 0) #define switch_channel_expand_variables(_channel, _in) switch_channel_expand_variables_check(_channel, _in, NULL, NULL, 0)
#define switch_channel_inbound_display(_channel) (switch_channel_direction(_channel) == SWITCH_CALL_DIRECTION_INBOUND || switch_channel_test_flag(_channel, CF_DIALPLAN))
SWITCH_DECLARE(char *) switch_channel_build_param_string(_In_ switch_channel_t *channel, _In_opt_ switch_caller_profile_t *caller_profile, SWITCH_DECLARE(char *) switch_channel_build_param_string(_In_ switch_channel_t *channel, _In_opt_ switch_caller_profile_t *caller_profile,
_In_opt_ const char *prefix); _In_opt_ const char *prefix);
......
...@@ -787,20 +787,38 @@ void sofia_send_callee_id(switch_core_session_t *session, const char *name, cons ...@@ -787,20 +787,38 @@ void sofia_send_callee_id(switch_core_session_t *session, const char *name, cons
switch_caller_profile_t *caller_profile = switch_channel_get_caller_profile(channel); switch_caller_profile_t *caller_profile = switch_channel_get_caller_profile(channel);
if (zstr(name)) { if (switch_channel_inbound_display(channel)) {
name = caller_profile->callee_id_name; if (zstr(name)) {
} name = caller_profile->caller_id_name;
}
if (zstr(number)) {
number = caller_profile->callee_id_number; if (zstr(number)) {
} number = caller_profile->caller_id_number;
}
if (zstr(name)) {
name = number; if (zstr(name)) {
} name = number;
}
if (zstr(number)) {
number = caller_profile->destination_number; if (zstr(number)) {
name = number = "UNKNOWN";
}
} else {
if (zstr(name)) {
name = caller_profile->callee_id_name;
}
if (zstr(number)) {
number = caller_profile->callee_id_number;
}
if (zstr(name)) {
name = number;
}
if (zstr(number)) {
number = caller_profile->destination_number;
}
} }
if ((uuid = switch_channel_get_partner_uuid(channel)) && (session_b = switch_core_session_locate(uuid))) { if ((uuid = switch_channel_get_partner_uuid(channel)) && (session_b = switch_core_session_locate(uuid))) {
...@@ -843,7 +861,7 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro ...@@ -843,7 +861,7 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro
} }
if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND) { if (switch_channel_inbound_display(channel)) {
name_var = "caller_id_name"; name_var = "caller_id_name";
num_var = "caller_id_number"; num_var = "caller_id_number";
ename_var = "effective_caller_id_name"; ename_var = "effective_caller_id_name";
...@@ -935,7 +953,7 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro ...@@ -935,7 +953,7 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro
caller_profile = switch_channel_get_caller_profile(channel); caller_profile = switch_channel_get_caller_profile(channel);
if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND) { if (switch_channel_inbound_display(channel)) {
if (!strcmp(caller_profile->caller_id_name, name) && !strcmp(caller_profile->caller_id_number, number)) { if (!strcmp(caller_profile->caller_id_name, name) && !strcmp(caller_profile->caller_id_number, number)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "%s Same Caller ID \"%s\" <%s>\n", switch_channel_get_name(channel), name, number); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "%s Same Caller ID \"%s\" <%s>\n", switch_channel_get_name(channel), name, number);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论