mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 20:51:58 +00:00
clear up some more display issues and fix resume-media-on-hold sofia option
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15177 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -784,15 +784,12 @@ SWITCH_STANDARD_APP(set_global_function)
|
||||
|
||||
SWITCH_STANDARD_APP(set_profile_var_function)
|
||||
{
|
||||
switch_caller_profile_t *caller_profile;
|
||||
char *name, *val = NULL;
|
||||
|
||||
caller_profile = switch_channel_get_caller_profile(switch_core_session_get_channel(session));
|
||||
|
||||
if (switch_strlen_zero(data)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
|
||||
} else {
|
||||
name = switch_core_strdup(caller_profile->pool, data);
|
||||
name = switch_core_session_strdup(session, data);
|
||||
val = strchr(name, '=');
|
||||
|
||||
if (val) {
|
||||
@@ -801,66 +798,8 @@ SWITCH_STANDARD_APP(set_profile_var_function)
|
||||
val = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "SET_PROFILE_VAR [%s]=[%s]\n", name, val ? val : "UNDEF");
|
||||
|
||||
if (!strcasecmp(name, "dialplan")) {
|
||||
caller_profile->dialplan = val;
|
||||
}
|
||||
if (!strcasecmp(name, "username")) {
|
||||
caller_profile->username = val;
|
||||
}
|
||||
if (!strcasecmp(name, "caller_id_name")) {
|
||||
caller_profile->caller_id_name = val;
|
||||
}
|
||||
if (!strcasecmp(name, "caller_id_number")) {
|
||||
caller_profile->caller_id_number = val;
|
||||
}
|
||||
if (!strcasecmp(name, "callee_id_name")) {
|
||||
caller_profile->callee_id_name = val;
|
||||
}
|
||||
if (!strcasecmp(name, "callee_id_number")) {
|
||||
caller_profile->callee_id_number = val;
|
||||
}
|
||||
if (val && !strcasecmp(name, "caller_ton")) {
|
||||
caller_profile->caller_ton = (uint8_t) atoi(val);
|
||||
}
|
||||
if (val && !strcasecmp(name, "caller_numplan")) {
|
||||
caller_profile->caller_numplan = (uint8_t) atoi(val);
|
||||
}
|
||||
if (val && !strcasecmp(name, "destination_number_ton")) {
|
||||
caller_profile->destination_number_ton = (uint8_t) atoi(val);
|
||||
}
|
||||
if (val && !strcasecmp(name, "destination_number_numplan")) {
|
||||
caller_profile->destination_number_numplan = (uint8_t) atoi(val);
|
||||
}
|
||||
if (!strcasecmp(name, "ani")) {
|
||||
caller_profile->ani = val;
|
||||
}
|
||||
if (!strcasecmp(name, "aniii")) {
|
||||
caller_profile->aniii = val;
|
||||
}
|
||||
if (!strcasecmp(name, "network_addr")) {
|
||||
caller_profile->network_addr = val;
|
||||
}
|
||||
if (!strcasecmp(name, "rdnis")) {
|
||||
caller_profile->rdnis = val;
|
||||
}
|
||||
if (!strcasecmp(name, "destination_number")) {
|
||||
caller_profile->destination_number = val;
|
||||
}
|
||||
if (!strcasecmp(name, "uuid")) {
|
||||
caller_profile->uuid = val;
|
||||
}
|
||||
if (!strcasecmp(name, "source")) {
|
||||
caller_profile->source = val;
|
||||
}
|
||||
if (!strcasecmp(name, "context")) {
|
||||
caller_profile->context = val;
|
||||
}
|
||||
if (!strcasecmp(name, "chan_name")) {
|
||||
caller_profile->chan_name = val;
|
||||
}
|
||||
|
||||
switch_channel_set_profile_var(switch_core_session_get_channel(session), name, val);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1232,7 +1232,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
switch_channel_clear_flag(channel, CF_PROXY_MODE);
|
||||
sofia_glue_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE);
|
||||
|
||||
if (!switch_channel_media_ready(channel)) {
|
||||
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);
|
||||
|
||||
@@ -2989,6 +2989,14 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
|
||||
switch_channel_set_variable(nchannel, "sip_invite_params", "intercom=true");
|
||||
}
|
||||
|
||||
if ((hval = switch_event_get_header(var_event, "sip_callee_id_name"))) {
|
||||
caller_profile->callee_id_name = switch_core_strdup(caller_profile->pool, hval);
|
||||
}
|
||||
|
||||
if ((hval = switch_event_get_header(var_event, "sip_callee_id_number"))) {
|
||||
caller_profile->callee_id_number = switch_core_strdup(caller_profile->pool, hval);
|
||||
}
|
||||
|
||||
if (session) {
|
||||
switch_channel_t *o_channel = switch_core_session_get_channel(session);
|
||||
const char *vval = NULL;
|
||||
@@ -3005,7 +3013,7 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
|
||||
switch_ivr_transfer_variable(session, nsession, "sip-force-contact");
|
||||
switch_ivr_transfer_variable(session, nsession, "sip_sticky_contact");
|
||||
switch_ivr_transfer_variable(session, nsession, "sip_cid_type");
|
||||
|
||||
|
||||
if (switch_core_session_compare(session, nsession)) {
|
||||
/* It's another sofia channel! so lets cache what they use as a pt for telephone event so
|
||||
we can keep it the same
|
||||
|
||||
@@ -3113,11 +3113,12 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
|
||||
caller_profile->network_addr = switch_core_strdup(caller_profile->pool, network_ip);
|
||||
}
|
||||
|
||||
switch_channel_clear_flag(channel, CF_REQ_MEDIA);
|
||||
|
||||
if ((status == 180 || status == 183 || status == 200)) {
|
||||
const char *x_actually_support;
|
||||
|
||||
switch_channel_set_flag(channel, CF_MEDIA_ACK);
|
||||
switch_channel_clear_flag(channel, CF_REQ_MEDIA);
|
||||
|
||||
if ((x_actually_support = sofia_glue_get_unknown_header(sip, "X-Actually-Support"))) {
|
||||
tech_pvt->x_actually_support_remote = switch_core_session_strdup(session, x_actually_support);
|
||||
|
||||
@@ -522,6 +522,7 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
|
||||
tech_pvt->session = session;
|
||||
tech_pvt->channel = switch_core_session_get_channel(session);
|
||||
switch_channel_set_cap(tech_pvt->channel, CC_MEDIA_ACK);
|
||||
switch_channel_set_cap(tech_pvt->channel, CC_BYPASS_MEDIA);
|
||||
|
||||
switch_core_session_set_private(session, tech_pvt);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user