FS-6418 FS-6427 add profile param NDLB-proxy-never-patch-reinvites to solve both issues
This commit is contained in:
parent
f8527f55f9
commit
bedf8327b6
|
@ -50,7 +50,8 @@ typedef enum {
|
||||||
SM_NDLB_ALLOW_NONDUP_SDP = (1 << 1),
|
SM_NDLB_ALLOW_NONDUP_SDP = (1 << 1),
|
||||||
SM_NDLB_ALLOW_CRYPTO_IN_AVP = (1 << 2),
|
SM_NDLB_ALLOW_CRYPTO_IN_AVP = (1 << 2),
|
||||||
SM_NDLB_DISABLE_SRTP_AUTH = (1 << 3),
|
SM_NDLB_DISABLE_SRTP_AUTH = (1 << 3),
|
||||||
SM_NDLB_SENDRECV_IN_SESSION = (1 << 4)
|
SM_NDLB_SENDRECV_IN_SESSION = (1 << 4),
|
||||||
|
SM_NDLB_NEVER_PATCH_REINVITE = (1 << 5)
|
||||||
} switch_core_media_NDLB_t;
|
} switch_core_media_NDLB_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
|
@ -4091,6 +4091,12 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
|
||||||
} else {
|
} else {
|
||||||
sofia_clear_pflag(profile, PFLAG_FORWARD_MWI_NOTIFY);
|
sofia_clear_pflag(profile, PFLAG_FORWARD_MWI_NOTIFY);
|
||||||
}
|
}
|
||||||
|
} else if (!strcasecmp(var, "NDLB-proxy-never-patch-reinvites")) {
|
||||||
|
if (switch_true(val)) {
|
||||||
|
profile->mndlb |= SM_NDLB_NEVER_PATCH_REINVITE;
|
||||||
|
} else {
|
||||||
|
profile->mndlb &= ~SM_NDLB_NEVER_PATCH_REINVITE;
|
||||||
|
}
|
||||||
} else if (!strcasecmp(var, "registration-thread-frequency")) {
|
} else if (!strcasecmp(var, "registration-thread-frequency")) {
|
||||||
profile->ireg_seconds = atoi(val);
|
profile->ireg_seconds = atoi(val);
|
||||||
if (profile->ireg_seconds < 0) {
|
if (profile->ireg_seconds < 0) {
|
||||||
|
@ -6722,7 +6728,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
|
if (switch_channel_test_flag(channel, CF_PROXY_MEDIA) && !(tech_pvt->profile->mndlb & SM_NDLB_NEVER_PATCH_REINVITE)) {
|
||||||
if (switch_core_media_proxy_remote_addr(session, r_sdp) == SWITCH_STATUS_SUCCESS && !is_t38) {
|
if (switch_core_media_proxy_remote_addr(session, r_sdp) == SWITCH_STATUS_SUCCESS && !is_t38) {
|
||||||
nua_respond(tech_pvt->nh, SIP_200_OK, TAG_END());
|
nua_respond(tech_pvt->nh, SIP_200_OK, TAG_END());
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Audio params changed, NOT proxying re-invite.\n");
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Audio params changed, NOT proxying re-invite.\n");
|
||||||
|
|
|
@ -7148,10 +7148,12 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
|
||||||
|
|
||||||
len = strlen(smh->mparams->local_sdp_str) * 2;
|
len = strlen(smh->mparams->local_sdp_str) * 2;
|
||||||
|
|
||||||
if (switch_channel_test_flag(session->channel, CF_ANSWERED) &&
|
if (!(smh->mparams->ndlb & SM_NDLB_NEVER_PATCH_REINVITE)) {
|
||||||
(switch_stristr("sendonly", smh->mparams->local_sdp_str) || switch_stristr("0.0.0.0", smh->mparams->local_sdp_str))) {
|
if (switch_channel_test_flag(session->channel, CF_ANSWERED) &&
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Skip patch on hold SDP\n");
|
(switch_stristr("sendonly", smh->mparams->local_sdp_str) || switch_stristr("0.0.0.0", smh->mparams->local_sdp_str))) {
|
||||||
return;
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Skip patch on hold SDP\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zstr(a_engine->local_sdp_ip) || !a_engine->local_sdp_port) {// || switch_channel_test_flag(session->channel, CF_PROXY_MEDIA)) {
|
if (zstr(a_engine->local_sdp_ip) || !a_engine->local_sdp_port) {// || switch_channel_test_flag(session->channel, CF_PROXY_MEDIA)) {
|
||||||
|
|
Loading…
Reference in New Issue