]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
some minor regressions from the last commit
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 29 Aug 2012 19:42:00 +0000 (14:42 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 29 Aug 2012 19:42:00 +0000 (14:42 -0500)
src/mod/endpoints/mod_sofia/sofia.c

index 58aba110767f6bac53d724de46b61a053702d685..85162d61b9b623b7fbef3db6e8bb884f0a1b110b 100644 (file)
@@ -1664,10 +1664,17 @@ void sofia_event_callback(nua_event_t event,
 
                        if ((session = switch_core_session_force_locate(sofia_private->uuid))) {
                                switch_channel_t *channel = switch_core_session_get_channel(session);
+                               switch_call_cause_t cause;
+
                                switch_channel_set_flag(channel, CF_NO_CDR);
-                               switch_channel_hangup(channel, status == 403 ? SWITCH_CAUSE_BEARERCAPABILITY_NOTAVAIL : SWITCH_CAUSE_BEARERCAPABILITY_NOTAUTH);
+
+                               cause = sofia_glue_sip_cause_to_freeswitch(status);
+
+                               switch_channel_hangup(channel, cause);
                                switch_core_session_rwunlock(session);
-                               switch_core_session_id_dec();
+                               if (status == 401 || status == 407) {
+                                       switch_core_session_id_dec();
+                               }
                        }
 
                }