git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16474 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2010-01-23 03:59:01 +00:00
parent 940781259c
commit 7299658c54
2 changed files with 46 additions and 24 deletions

View File

@ -1405,11 +1405,13 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
{
uint32_t send_invite = 1;
switch_channel_clear_flag(channel, CF_PROXY_MODE);
sofia_glue_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE);
if (!(switch_channel_test_flag(channel, CF_ANSWERED) || switch_channel_test_flag(channel, CF_EARLY_MEDIA))) {
if (!switch_channel_test_flag(tech_pvt->channel, CF_OUTBOUND)) {
const char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
tech_pvt->num_codecs = 0;
sofia_glue_tech_prepare_codecs(tech_pvt);
if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {
@ -1432,7 +1434,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
if (send_invite) {
switch_channel_set_flag(channel, CF_REQ_MEDIA);
switch_channel_clear_flag(channel, CF_PROXY_MODE);
sofia_glue_do_invite(session);
}
}

View File

@ -51,12 +51,22 @@ void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *
}
}
if (!ip) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "%s NO IP!\n", switch_channel_get_name(tech_pvt->channel));
return;
}
if (!port) {
if (!(port = tech_pvt->adv_sdp_audio_port)) {
port = tech_pvt->proxy_sdp_audio_port;
}
}
if (!port) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "%s NO PORT!\n", switch_channel_get_name(tech_pvt->channel));
return;
}
if (!tech_pvt->owner_id) {
tech_pvt->owner_id = (uint32_t) switch_epoch_time_now(NULL) - port;
}
@ -141,12 +151,23 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32
ip = tech_pvt->proxy_sdp_audio_ip;
}
}
if (!ip) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "%s NO IP!\n", switch_channel_get_name(tech_pvt->channel));
return;
}
if (!port) {
if (!(port = tech_pvt->adv_sdp_audio_port)) {
port = tech_pvt->proxy_sdp_audio_port;
}
}
if (!port) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "%s NO PORT!\n", switch_channel_get_name(tech_pvt->channel));
return;
}
if (!sr) {
sr = "sendrecv";
}