]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3594 if this does not work you will need to give me access to your box
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 4 Oct 2011 22:46:49 +0000 (17:46 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 4 Oct 2011 22:46:49 +0000 (17:46 -0500)
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_reg.c

index 775722f6efd2cb63943ede215c2a42a71a6b5154..c2b344cdf7ecc1cf735bb89f8d992f33993e2b84 100644 (file)
@@ -808,7 +808,7 @@ static void our_sofia_event_callback(nua_event_t event,
        int check_destroy = 1;
 
 
-       if (sofia_private && sofia_private->de) {
+       if (sofia_private && sofia_private->is_call && sofia_private->de) {
                sofia_dispatch_event_t *qde = sofia_private->de;
                sofia_private->de = NULL;
                sofia_process_dispatch_event(&qde);
index a65c205b8f9026f7882ceb92444ca4278a126df2..bccae9293f664877a36747d28274399b5f296eb0 100644 (file)
@@ -68,6 +68,10 @@ static void sofia_reg_new_handle(sofia_gateway_t *gateway_ptr, int attach)
 static void sofia_reg_kill_reg(sofia_gateway_t *gateway_ptr)
 {
 
+       if (gateway_ptr->nh) {
+               nua_handle_bind(gateway_ptr->nh, NULL);
+       }
+
        if (gateway_ptr->state != REG_STATE_REGED) {
                if (gateway_ptr->nh) {
                        nua_handle_destroy(gateway_ptr->nh);
@@ -76,19 +80,10 @@ static void sofia_reg_kill_reg(sofia_gateway_t *gateway_ptr)
                return;
        }
 
-       /*
-          if (!gateway_ptr->nh) {
-          sofia_reg_new_handle(gateway_ptr, SWITCH_FALSE);
-          }
-        */
-
        if (gateway_ptr->nh) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "UN-Registering %s\n", gateway_ptr->name);
                nua_unregister(gateway_ptr->nh, NUTAG_URL(gateway_ptr->register_url), NUTAG_REGISTRAR(gateway_ptr->register_proxy), TAG_END());
        }
-
-
-
 }
 
 void sofia_reg_fire_custom_gateway_state_event(sofia_gateway_t *gateway, int status, const char *phrase)
@@ -114,6 +109,10 @@ void sofia_reg_unregister(sofia_profile_t *profile)
        switch_mutex_lock(mod_sofia_globals.hash_mutex);
        for (gateway_ptr = profile->gateways; gateway_ptr; gateway_ptr = gateway_ptr->next) {
 
+               if (gateway_ptr->nh) {
+                       nua_handle_bind(gateway_ptr->nh, NULL);
+               }
+
                if (gateway_ptr->sofia_private) {
                        sofia_private_free(gateway_ptr->sofia_private);
                }