Revision
15365
Author
anthm
Date
2009-11-04 23:01:41 -0600 (Wed, 04 Nov 2009)

Log Message

reset handle on bad reg

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (15364 => 15365)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	2009-11-05 04:21:08 UTC (rev 15364)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	2009-11-05 05:01:41 UTC (rev 15365)
@@ -1381,6 +1381,16 @@
 									 nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip,
 									 tagi_t tags[])
 {
+	if (status >= 900) {
+		if (sofia_private && sofia_private->gateway) {
+			nua_handle_destroy(sofia_private->gateway->nh);
+			sofia_private->gateway->nh = NULL;
+			sofia_private->gateway->state = REG_STATE_UNREGED;
+
+		}
+		return;
+	}
+
 	if (sofia_private && sofia_private->gateway) {
 		reg_state_t ostate = sofia_private->gateway->state;
 		switch (status) {