MODSOFIA-59 (part 2)
This commit is contained in:
parent
e8f5bbae28
commit
a0c641aeb7
|
@ -740,6 +740,7 @@ typedef enum {
|
||||||
SWITCH_MESSAGE_INDICATE_PHONE_EVENT,
|
SWITCH_MESSAGE_INDICATE_PHONE_EVENT,
|
||||||
SWITCH_MESSAGE_INDICATE_T38_DESCRIPTION,
|
SWITCH_MESSAGE_INDICATE_T38_DESCRIPTION,
|
||||||
SWITCH_MESSAGE_INDICATE_UDPTL_MODE,
|
SWITCH_MESSAGE_INDICATE_UDPTL_MODE,
|
||||||
|
SWITCH_MESSAGE_INDICATE_CLEAR_PROGRESS,
|
||||||
SWITCH_MESSAGE_INVALID
|
SWITCH_MESSAGE_INVALID
|
||||||
} switch_core_session_message_types_t;
|
} switch_core_session_message_types_t;
|
||||||
|
|
||||||
|
|
|
@ -1435,6 +1435,11 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||||
}
|
}
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
case SWITCH_MESSAGE_INDICATE_CLEAR_PROGRESS:
|
||||||
|
if (!switch_channel_test_flag(channel, CF_ANSWERED)) {
|
||||||
|
sofia_clear_flag(tech_pvt, TFLAG_EARLY_MEDIA);
|
||||||
|
}
|
||||||
|
goto end;
|
||||||
case SWITCH_MESSAGE_INDICATE_ANSWER:
|
case SWITCH_MESSAGE_INDICATE_ANSWER:
|
||||||
case SWITCH_MESSAGE_INDICATE_PROGRESS:
|
case SWITCH_MESSAGE_INDICATE_PROGRESS:
|
||||||
{
|
{
|
||||||
|
@ -2179,6 +2184,14 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||||
if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
|
if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
|
||||||
char *extra_header = sofia_glue_get_extra_headers(channel, SOFIA_SIP_PROGRESS_HEADER_PREFIX);
|
char *extra_header = sofia_glue_get_extra_headers(channel, SOFIA_SIP_PROGRESS_HEADER_PREFIX);
|
||||||
|
|
||||||
|
if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE) &&
|
||||||
|
tech_pvt->early_sdp && strcmp(tech_pvt->early_sdp, tech_pvt->local_sdp_str)) {
|
||||||
|
/* The SIP RFC for SOA forbids sending a 183 with one sdp then a 200 with another but it won't do us much good unless
|
||||||
|
we do so in this case we will abandon the SOA rules and go rogue.
|
||||||
|
*/
|
||||||
|
sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);
|
||||||
|
}
|
||||||
|
|
||||||
tech_pvt->early_sdp = switch_core_session_strdup(tech_pvt->session, tech_pvt->local_sdp_str);
|
tech_pvt->early_sdp = switch_core_session_strdup(tech_pvt->session, tech_pvt->local_sdp_str);
|
||||||
|
|
||||||
if (sofia_use_soa(tech_pvt)) {
|
if (sofia_use_soa(tech_pvt)) {
|
||||||
|
|
|
@ -598,6 +598,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_receive_message(swit
|
||||||
switch_channel_get_name(session->channel), message_names[message->message_id]);
|
switch_channel_get_name(session->channel), message_names[message->message_id]);
|
||||||
|
|
||||||
|
|
||||||
|
if (message->message_id == SWITCH_MESSAGE_INDICATE_CLEAR_PROGRESS) {
|
||||||
|
switch_channel_clear_flag(session->channel, CF_EARLY_MEDIA);
|
||||||
|
}
|
||||||
|
|
||||||
if (message->message_id == SWITCH_MESSAGE_INDICATE_DISPLAY &&
|
if (message->message_id == SWITCH_MESSAGE_INDICATE_DISPLAY &&
|
||||||
switch_true(switch_channel_get_variable(session->channel, SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE))) {
|
switch_true(switch_channel_get_variable(session->channel, SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE))) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line,
|
switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line,
|
||||||
|
|
|
@ -1797,6 +1797,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bypass_media && switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA) && !switch_channel_test_flag(caller_channel, CF_ANSWERED)) {
|
||||||
|
switch_core_session_message_t msg = { 0 };
|
||||||
|
|
||||||
|
msg.message_id = SWITCH_MESSAGE_INDICATE_CLEAR_PROGRESS;
|
||||||
|
msg.from = __FILE__;
|
||||||
|
switch_core_session_receive_message(session, &msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!zstr(bypass_media) && !switch_channel_test_flag(caller_channel, CF_PROXY_MEDIA)) {
|
if (!zstr(bypass_media) && !switch_channel_test_flag(caller_channel, CF_PROXY_MEDIA)) {
|
||||||
if (switch_true(bypass_media)) {
|
if (switch_true(bypass_media)) {
|
||||||
switch_channel_set_flag(caller_channel, CF_PROXY_MODE);
|
switch_channel_set_flag(caller_channel, CF_PROXY_MODE);
|
||||||
|
|
Loading…
Reference in New Issue