]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 12 May 2008 14:19:48 +0000 (14:19 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 12 May 2008 14:19:48 +0000 (14:19 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8360 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_reg.c

index e0a55b12d71546ee6b071d0c766281c2344ef42d..847aab2661318127d87af1326ce6d271462df6bf 100644 (file)
@@ -345,6 +345,10 @@ void sofia_event_callback(nua_event_t event,
        default:
                if (nh && ((sofia_private && sofia_private->destroy_nh) || !nua_handle_magic(nh))) {
                        //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Destroy handle [%s]\n", nua_event_name(event));
+                       if (sofia_private) {
+                               nua_handle_bind(nh, NULL);
+                               sofia_private->destroy_me = 1;
+                       }
                        nua_handle_destroy(nh);
                }
                break;
@@ -1532,8 +1536,6 @@ static void sofia_handle_sip_r_options(switch_core_session_t *session, int statu
                }
                gateway->ping = switch_timestamp(NULL) + gateway->ping_freq;
                sofia_reg_release_gateway(gateway);
-               nua_handle_bind(nh, NULL);
-               free(sofia_private);
                gateway->pinging = 0;
        } else if ((profile->pflags & PFLAG_UNREG_OPTIONS_FAIL) && status != 200 && sip && sip->sip_to) {
                char *sql;
index 0f22ffd05abbf3998b289e4f95f2dbeceebf3715..656284f53a24ebff32a6b9b346b2aa63463a18f3 100644 (file)
@@ -88,6 +88,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
                        switch_assert(pvt);
                        memset(pvt, 0, sizeof(*pvt));
                        pvt->destroy_nh = 1;
+                       pvt->destroy_me = 1;
                        switch_copy_string(pvt->gateway_name, gateway_ptr->name, sizeof(pvt->gateway_name));
                        nua_handle_bind(nh, pvt);