mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 20:51:58 +00:00
MODENDP-312
This commit is contained in:
@@ -1195,6 +1195,39 @@ static switch_status_t sofia_kill_channel(switch_core_session_t *session, int si
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static void start_udptl(private_object_t *tech_pvt, switch_t38_options_t *t38_options)
|
||||
{
|
||||
|
||||
if (switch_rtp_ready(tech_pvt->rtp_session)) {
|
||||
char *remote_host = switch_rtp_get_remote_host(tech_pvt->rtp_session);
|
||||
switch_port_t remote_port = switch_rtp_get_remote_port(tech_pvt->rtp_session);
|
||||
const char *err, *val;
|
||||
|
||||
switch_rtp_udptl_mode(tech_pvt->rtp_session);
|
||||
|
||||
if (remote_host && remote_port && !strcmp(remote_host, t38_options->remote_ip) && remote_port == t38_options->remote_port) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "Remote address:port [%s:%d] has not changed.\n",
|
||||
t38_options->remote_ip, t38_options->remote_port);
|
||||
return;
|
||||
}
|
||||
|
||||
if (switch_rtp_set_remote_address(tech_pvt->rtp_session, t38_options->remote_ip,
|
||||
t38_options->remote_port, 0, SWITCH_TRUE, &err) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "IMAGE UDPTL REPORTS ERROR: [%s]\n", err);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "IMAGE UDPTL CHANGING DEST TO: [%s:%d]\n",
|
||||
t38_options->remote_ip, t38_options->remote_port);
|
||||
if (!sofia_test_pflag(tech_pvt->profile, PFLAG_DISABLE_RTP_AUTOADJ) &&
|
||||
!((val = switch_channel_get_variable(tech_pvt->channel, "disable_udptl_auto_adjust")) && switch_true(val))) {
|
||||
/* Reactivate the NAT buster flag. */
|
||||
switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static switch_status_t sofia_send_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf)
|
||||
{
|
||||
private_object_t *tech_pvt;
|
||||
@@ -1528,12 +1561,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
nua_respond(tech_pvt->nh, SIP_488_NOT_ACCEPTABLE, TAG_END());
|
||||
goto end_lock;
|
||||
}
|
||||
|
||||
start_udptl(tech_pvt, t38_options);
|
||||
|
||||
if (switch_rtp_ready(tech_pvt->rtp_session)) {
|
||||
switch_rtp_udptl_mode(tech_pvt->rtp_session);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SWITCH_MESSAGE_INDICATE_T38_DESCRIPTION:
|
||||
{
|
||||
switch_t38_options_t *t38_options = switch_channel_get_private(tech_pvt->channel, "t38_options");
|
||||
@@ -1543,13 +1574,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
goto end_lock;
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(tech_pvt->rtp_session)) {
|
||||
switch_rtp_udptl_mode(tech_pvt->rtp_session);
|
||||
}
|
||||
start_udptl(tech_pvt, t38_options);
|
||||
|
||||
|
||||
sofia_glue_set_image_sdp(tech_pvt, t38_options, msg->numeric_arg);
|
||||
|
||||
|
||||
if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
|
||||
char *extra_headers = sofia_glue_get_extra_headers(channel, SOFIA_SIP_RESPONSE_HEADER_PREFIX);
|
||||
if (sofia_use_soa(tech_pvt)) {
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *t38_options, int insist)
|
||||
{
|
||||
char buf[2048];
|
||||
const char *ip = t38_options->ip;
|
||||
uint32_t port = t38_options->port;
|
||||
const char *ip = t38_options->local_ip;
|
||||
uint32_t port = t38_options->local_port;
|
||||
const char *family = "IP4";
|
||||
const char *username = tech_pvt->profile->username;
|
||||
|
||||
@@ -3409,13 +3409,13 @@ void sofia_glue_copy_t38_options(switch_t38_options_t *t38_options, switch_core_
|
||||
local_t38_options->T38FaxFillBitRemoval = t38_options->T38FaxFillBitRemoval;
|
||||
local_t38_options->T38FaxTranscodingMMR = t38_options->T38FaxTranscodingMMR;
|
||||
local_t38_options->T38FaxTranscodingJBIG = t38_options->T38FaxTranscodingJBIG;
|
||||
local_t38_options->T38FaxRateManagement = t38_options->T38FaxRateManagement;
|
||||
local_t38_options->T38FaxRateManagement = switch_core_session_strdup(session, t38_options->T38FaxRateManagement);
|
||||
local_t38_options->T38FaxMaxBuffer = t38_options->T38FaxMaxBuffer;
|
||||
local_t38_options->T38FaxMaxDatagram = t38_options->T38FaxMaxDatagram;
|
||||
local_t38_options->T38FaxUdpEC = t38_options->T38FaxUdpEC;
|
||||
local_t38_options->T38VendorInfo = t38_options->T38VendorInfo;
|
||||
local_t38_options->ip = NULL;
|
||||
local_t38_options->port = 0;
|
||||
local_t38_options->T38FaxUdpEC = switch_core_session_strdup(session, t38_options->T38FaxUdpEC);
|
||||
local_t38_options->T38VendorInfo = switch_core_session_strdup(session, t38_options->T38VendorInfo);
|
||||
local_t38_options->remote_ip = switch_core_session_strdup(session, t38_options->remote_ip);
|
||||
local_t38_options->remote_port = t38_options->remote_port;
|
||||
|
||||
|
||||
switch_channel_set_private(channel, "t38_options", local_t38_options);
|
||||
@@ -3430,12 +3430,12 @@ static switch_t38_options_t *tech_process_udptl(private_object_t *tech_pvt, sdp_
|
||||
t38_options = switch_core_session_alloc(tech_pvt->session, sizeof(switch_t38_options_t));
|
||||
}
|
||||
|
||||
t38_options->port = m->m_port;
|
||||
t38_options->remote_port = m->m_port;
|
||||
|
||||
if (m->m_connections) {
|
||||
t38_options->ip = switch_core_session_strdup(tech_pvt->session, m->m_connections->c_address);
|
||||
t38_options->remote_ip = switch_core_session_strdup(tech_pvt->session, m->m_connections->c_address);
|
||||
} else if (sdp && sdp->sdp_connection) {
|
||||
t38_options->ip = switch_core_session_strdup(tech_pvt->session, sdp->sdp_connection->c_address);
|
||||
t38_options->remote_ip = switch_core_session_strdup(tech_pvt->session, sdp->sdp_connection->c_address);
|
||||
}
|
||||
|
||||
for (attr = m->m_attributes; attr; attr = attr->a_next) {
|
||||
|
||||
Reference in New Issue
Block a user