]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
destroy handle on bad authenticate
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 24 Jun 2010 18:19:14 +0000 (13:19 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 24 Jun 2010 18:19:14 +0000 (13:19 -0500)
src/mod/endpoints/mod_sofia/sofia.c

index e2675a4c8758df38426b7f078f54565c0e572ca5..77c9fdd24c30de1f86abeaf84be17768b656771d 100644 (file)
@@ -890,6 +890,18 @@ void sofia_event_callback(nua_event_t event,
                break;
        case nua_i_subscribe:
                sofia_presence_handle_sip_i_subscribe(status, phrase, nua, profile, nh, sofia_private, sip, tags);
+               break;
+       case nua_r_authenticate:
+
+               if (status >= 500) {
+                       if (sofia_private && sofia_private->gateway) {
+                               nua_handle_destroy(sofia_private->gateway->nh);
+                               sofia_private->gateway->nh = NULL;
+                       } else {
+                               nua_handle_destroy(nh);
+                       }
+               }
+               
                break;
        default:
                if (status > 100) {