]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3487 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 5 Aug 2011 01:26:23 +0000 (20:26 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 5 Aug 2011 01:26:23 +0000 (20:26 -0500)
src/mod/endpoints/mod_sofia/sofia.c

index 7a5fe8fc748b0a947c13c903b33a0ccd57821aec..7932eeed8b3f68a862a4055211c84d302375db2e 100644 (file)
@@ -85,7 +85,7 @@ void sofia_handle_sip_r_notify(switch_core_session_t *session, int status,
                                                                sofia_dispatch_event_t *de, tagi_t tags[])
 {
 
-       if (status >= 300 && sip && sip->sip_call_id) {
+       if (status >= 300 && sip && sip->sip_call_id && (!sofia_private || !sofia_private->is_call)) {
                char *sql;
                sql = switch_mprintf("delete from sip_subscriptions where call_id='%q'", sip->sip_call_id->i_id);
                switch_assert(sql != NULL);
@@ -5161,7 +5161,8 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
        if (channel && (status == 180 || status == 183) && switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
                const char *val;
                if ((val = switch_channel_get_variable(channel, "sip_auto_answer")) && switch_true(val)) {
-                       nua_notify(nh, NUTAG_NEWSUB(1), NUTAG_SUBSTATE(nua_substate_active), SIPTAG_EVENT_STR("talk"), TAG_END());
+                       nua_notify(nh, NUTAG_NEWSUB(1), NUTAG_WITH_THIS_MSG(de->data->e_msg), 
+                                          NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_EVENT_STR("talk"), TAG_END());
                }
        }