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

cleanup

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15154 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 0fe0604f
...@@ -1280,7 +1280,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi ...@@ -1280,7 +1280,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
} }
if (!switch_strlen_zero(name)) { if (!switch_strlen_zero(name)) {
char message[256] = ""; char message[256] = "";
const char *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent"); const char *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent");
...@@ -1290,6 +1289,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi ...@@ -1290,6 +1289,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
number = tech_pvt->caller_profile->destination_number; number = tech_pvt->caller_profile->destination_number;
} }
if (switch_strlen_zero(tech_pvt->last_sent_callee_id_name) || strcmp(tech_pvt->last_sent_callee_id_name, name) ||
switch_strlen_zero(tech_pvt->last_sent_callee_id_number) || strcmp(tech_pvt->last_sent_callee_id_number, number)) {
if (ua && switch_stristr("snom", ua)) { if (ua && switch_stristr("snom", ua)) {
snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", name, number); snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", name, number);
nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"), nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
...@@ -1304,7 +1306,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi ...@@ -1304,7 +1306,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
TAG_END()); TAG_END());
} }
tech_pvt->last_sent_callee_id_name = switch_core_session_strdup(tech_pvt->session, name);
tech_pvt->last_sent_callee_id_number = switch_core_session_strdup(tech_pvt->session, number);
if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) { if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
...@@ -1317,6 +1320,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi ...@@ -1317,6 +1320,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch_channel_event_set_data(channel, event); switch_channel_event_set_data(channel, event);
switch_event_fire(&event); switch_event_fire(&event);
} }
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Not sending same id again \"%s\" <%s>\n", name, number);
}
......
...@@ -583,6 +583,8 @@ struct private_object { ...@@ -583,6 +583,8 @@ struct private_object {
char *route_uri; char *route_uri;
char *x_actually_support_remote; char *x_actually_support_remote;
char *x_actually_support_local; char *x_actually_support_local;
char *last_sent_callee_id_name;
char *last_sent_callee_id_number;
switch_port_t stun_port; switch_port_t stun_port;
uint32_t stun_flags; uint32_t stun_flags;
unsigned long rm_rate; unsigned long rm_rate;
......
...@@ -432,9 +432,7 @@ SWITCH_STANDARD_APP(socket_function) ...@@ -432,9 +432,7 @@ SWITCH_STANDARD_APP(socket_function)
switch_ivr_park(session, NULL); switch_ivr_park(session, NULL);
if (switch_core_session_private_event_count(session)) {
switch_ivr_parse_all_events(session); switch_ivr_parse_all_events(session);
}
if (switch_test_flag(listener, LFLAG_RESUME) || ((var = switch_channel_get_variable(channel, "socket_resume")) && switch_true(var))) { if (switch_test_flag(listener, LFLAG_RESUME) || ((var = switch_channel_get_variable(channel, "socket_resume")) && switch_true(var))) {
switch_channel_set_state(channel, CS_EXECUTE); switch_channel_set_state(channel, CS_EXECUTE);
......
...@@ -298,6 +298,8 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) ...@@ -298,6 +298,8 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
switch_core_session_kill_channel(session_b, SWITCH_SIG_BREAK); switch_core_session_kill_channel(session_b, SWITCH_SIG_BREAK);
} }
switch_ivr_parse_all_messages(session_a);
if (!inner_bridge && (switch_channel_test_flag(chan_a, CF_SUSPEND) || switch_channel_test_flag(chan_b, CF_SUSPEND))) { if (!inner_bridge && (switch_channel_test_flag(chan_a, CF_SUSPEND) || switch_channel_test_flag(chan_b, CF_SUSPEND))) {
status = switch_core_session_read_frame(session_a, &read_frame, SWITCH_IO_FLAG_NONE, stream_id); status = switch_core_session_read_frame(session_a, &read_frame, SWITCH_IO_FLAG_NONE, stream_id);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论