]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix jira issue FSCORE-164
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 29 Jul 2008 17:54:42 +0000 (17:54 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 29 Jul 2008 17:54:42 +0000 (17:54 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9204 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c

index fc2e19e940a36e8aa62ea5cec01a9fb8412817e4..1edccedf50c3d1757ec3e786959fd4d79d983c35 100644 (file)
@@ -111,6 +111,7 @@ struct sofia_private {
        char gateway_name[512];
        int destroy_nh;
        int destroy_me;
+       int is_call;
 };
 
 #define set_param(ptr,val) if (ptr) {free(ptr) ; ptr = NULL;} if (val) {ptr = strdup(val);}
index 093fd5f49be130d01af9143339bec27be78b7d05..b3a55c607c4ae77f7aa5d2f65aaa6a15fb417732 100644 (file)
@@ -205,6 +205,8 @@ void sofia_event_callback(nua_event_t event,
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel is already hungup.\n");
                        goto done;
                }
+       } else if (sofia_private && sofia_private->is_call) {
+               sofia_private->destroy_me = 22;
        }
 
        if ((profile->pflags & PFLAG_AUTH_ALL) && tech_pvt && tech_pvt->key && sip) {
@@ -353,6 +355,7 @@ void sofia_event_callback(nua_event_t event,
                        nua_handle_bind(nh, NULL);
                }
                sofia_private->destroy_me = 12;
+
                free(sofia_private);
                sofia_private = NULL;
        }
@@ -3559,6 +3562,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
        }
 
        memset(sofia_private, 0, sizeof(*sofia_private));
+       sofia_private->is_call++;
        tech_pvt->sofia_private = sofia_private;
 
        if ((profile->pflags & PFLAG_PRESENCE)) {
index e0bf13c7d15f25d511415151e37ce047558b3ee7..217ad4b8f3259216d3f1b83caafc7bfde66fd965 100644 (file)
@@ -1206,7 +1206,10 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
                if (!(sofia_private = malloc(sizeof(*sofia_private)))) {
                        abort();
                }
+
                memset(sofia_private, 0, sizeof(*sofia_private));
+               sofia_private->is_call++;
+
                tech_pvt->sofia_private = sofia_private;
                switch_copy_string(tech_pvt->sofia_private->uuid, switch_core_session_get_uuid(session), sizeof(tech_pvt->sofia_private->uuid));
                nua_handle_bind(tech_pvt->nh, tech_pvt->sofia_private);