[Freeswitch-svn] [commit] r8375 - freeswitch/trunk/src/mod/endpoints/mod_sofia
Freeswitch SVN
mikej at freeswitch.org
Mon May 12 20:50:12 EDT 2008
Author: mikej
Date: Mon May 12 20:50:12 2008
New Revision: 8375
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
Log:
don't pass around 0 status (possible fix for MODENDP-107)
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Mon May 12 20:50:12 2008
@@ -226,9 +226,11 @@
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) {
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Mon May 12 20:50:12 2008
@@ -2106,10 +2106,12 @@
} 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);
More information about the Freeswitch-svn
mailing list