don't pass around 0 status (possible fix for MODENDP-107)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8375 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-05-13 00:50:12 +00:00
parent 329e8d682b
commit 700da9b4de
2 changed files with 11 additions and 7 deletions

View File

@ -226,9 +226,11 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
if (!switch_strlen_zero(ps_cause) && !strncasecmp(ps_cause, "sip:", 4)) {
int new_cause = atoi(ps_cause + 4);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Overriding SIP cause %d with %d from the other leg\n",
switch_channel_get_name(channel), sip_cause, new_cause);
sip_cause = new_cause;
if (new_cause) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Overriding SIP cause %d with %d from the other leg\n",
switch_channel_get_name(channel), sip_cause, new_cause);
sip_cause = new_cause;
}
}
if (switch_test_flag(tech_pvt, TFLAG_SIP_HOLD) && cause != SWITCH_CAUSE_ATTENDED_TRANSFER) {

View File

@ -2106,10 +2106,12 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
} else {
cause = sofia_glue_sip_cause_to_freeswitch(status);
}
switch_snprintf(st, sizeof(st), "%d", status);
switch_channel_set_variable(channel, "sip_term_status", st);
switch_snprintf(st, sizeof(st), "sip:%d", status);
switch_channel_set_variable_partner(channel, SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE, st);
if (status) {
switch_snprintf(st, sizeof(st), "%d", status);
switch_channel_set_variable(channel, "sip_term_status", st);
switch_snprintf(st, sizeof(st), "sip:%d", status);
switch_channel_set_variable_partner(channel, SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE, st);
}
switch_snprintf(st, sizeof(st), "%d", cause);
switch_channel_set_variable(channel, "sip_term_cause", st);
switch_channel_hangup(channel, cause);