[Freeswitch-svn] [commit] r7833 - freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua

Freeswitch SVN mikej at freeswitch.org
Fri Mar 7 14:20:27 EST 2008


Author: mikej
Date: Fri Mar  7 14:20:27 2008
New Revision: 7833

Modified:
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c

Log:
revert for now the following patch which introduces a segfault:

Tue Feb 26 11:09:37 EST 2008  Pekka.Pessi at nokia.com
* nua: initial fix for sf.net bug #1827511

BYE can now be challenged.




Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c	Fri Mar  7 14:20:27 2008
@@ -379,12 +379,8 @@
     /* Destroy saved client request */
     if (cr0 != du->du_cr && nua_client_is_bound(du->du_cr)) {
       nua_client_bind(cr = du->du_cr, NULL);
-
-      if (nua_client_is_queued(cr))
-	nua_client_request_complete(cr);
-      else if (nua_client_is_reporting(cr))
-	;
-      else
+      if (!nua_client_is_queued(cr) &&
+	  !nua_client_is_reporting(cr))
 	nua_client_request_destroy(cr);
     }
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c	Fri Mar  7 14:20:27 2008
@@ -177,7 +177,6 @@
   NHP_SET(nhp, refer_with_id, 1);
 
   NHP_SET(nhp, substate, nua_substate_active);
-  NHP_SET(nhp, sub_expires, 3600);
 
   NHP_SET(nhp, allow, sip_allow_make(home, nua_allow_str));
   NHP_SET(nhp, supported, sip_supported_make(home, "timer, 100rel"));

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c	Fri Mar  7 14:20:27 2008
@@ -247,8 +247,7 @@
 
   cr = du->du_cr;
 
-  if (cr != cr0 && cr && cr->cr_orq && cr->cr_status >= 200 && 
-      cr->cr_method == sip_method_invite) {
+  if (cr != cr0 && cr && cr->cr_orq && cr->cr_status >= 200) {
     ss->ss_reporting = 1;
     nua_invite_client_ack(cr, NULL);
     ss->ss_reporting = 0;
@@ -267,13 +266,11 @@
     if (cr == du->du_cr && cr->cr_orq)
       continue;
 
-    if (cr->cr_status < 200) {
-      nua_stack_event(nh->nh_nua, nh, 
-		      NULL,
-		      cr->cr_event,
-		      SIP_481_NO_TRANSACTION,
-		      NULL);
-    }
+    nua_stack_event(nh->nh_nua, nh, 
+   	      NULL,
+          cr->cr_event,
+	      SIP_481_NO_TRANSACTION,
+		  NULL);
 
     nua_client_request_destroy(cr);
 
@@ -729,15 +726,10 @@
   if (!du)
     return -1;
 
-  ss = nua_dialog_usage_private(du);
-
-  if (ss->ss_state >= nua_callstate_terminating)
-    return nua_client_return(cr, 900, "Session is terminating", msg);
-
   if (nua_client_bind(cr, du) < 0)
     return nua_client_return(cr, 900, "INVITE already in progress", msg);
 
-  cr->cr_neutral = 0;
+  ss = nua_dialog_usage_private(du);
 
   session_timer_preferences(ss->ss_timer,
 			    sip,
@@ -747,6 +739,8 @@
 			    NH_PGET(nh, refresher),
 			    NH_PGET(nh, min_se));
 
+  cr->cr_neutral = 0;
+
   return 0;
 }
 
@@ -763,9 +757,6 @@
   if (du == NULL)		/* Call terminated */ 
     return nua_client_return(cr, SIP_481_NO_TRANSACTION, msg);
 
-  if (ss->ss_state >= nua_callstate_terminating)
-    return nua_client_return(cr, 900, "Session is terminating", msg);
-
   assert(ss);
 
   invite_timeout = NH_PGET(nh, invite_timeout);
@@ -1178,7 +1169,7 @@
   if (error < 0) {
     if (ss->ss_reason == NULL)
       ss->ss_reason = "SIP;cause=500;text=\"Internal Error\"";
-    ss->ss_reporting = 1;	/* We report terminated state here if BYE fails */
+    ss->ss_reporting = 1;	/* We report state here if BYE fails */
     error = nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL);
     ss->ss_reporting = 0;
     signal_call_state_change(nh, ss, 500, "Internal Error", 
@@ -1221,7 +1212,6 @@
   char const *invite_branch;
 
   assert(cr->cr_orq);
-  assert(cr->cr_method == sip_method_invite);
 
 
   if (!ds->ds_leg) {
@@ -1678,8 +1668,6 @@
   if (du == NULL)		/* Call terminated */
     return nua_client_return(cr, SIP_481_NO_TRANSACTION, msg);
   assert(ss);
-  if (ss->ss_state >= nua_callstate_terminating)
-    return nua_client_return(cr, 900, "Session is terminating", msg);
 
   cri = du->du_cr;
 
@@ -2470,7 +2458,7 @@
       nua_stack_event(nh->nh_nua, nh, NULL,
 		      nua_i_media_error, status, phrase, NULL);
 
-      ss->ss_reporting = 1;	/* We report terminated state here if BYE fails */
+      ss->ss_reporting = 1;	/* We report state here if BYE fails */
       error = nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL);
       ss->ss_reporting = 0;
 
@@ -2567,7 +2555,7 @@
   /* send BYE, too, if 200 OK (or 183 to re-INVITE) timeouts  */
   ss->ss_reason = reason;
 
-  ss->ss_reporting = 1;		/* We report terminated state here if BYE fails */
+  ss->ss_reporting = 1;		/* We report state here if BYE fails */
   error = nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL);
   ss->ss_reporting = 0;
 
@@ -3139,8 +3127,6 @@
   if (du == NULL)		/* Call terminated */
     return nua_client_return(cr, SIP_481_NO_TRANSACTION, msg);
   assert(ss);
-  if (ss->ss_state >= nua_callstate_terminating)
-    return nua_client_return(cr, 900, "Session is terminating", msg);
 
   cri = du->du_cr;
 
@@ -3601,9 +3587,7 @@
 
   if (nh->nh_soa)
     soa_terminate(nh->nh_soa, 0);
-
-  du->du_cr = NULL;
-  nua_client_bind(cr, du);
+  cr->cr_usage = du;
 
   return 0;
 }
@@ -3675,23 +3659,17 @@
   else {
     nua_session_usage_t *ss = nua_dialog_usage_private(du);
 
-    if (ss->ss_reporting) {
-      return 1;			/* Somebody else's problem */
-    }
-    else if (cr->cr_waiting) {
-      return 1; /* Application problem */
-    }
-
     signal_call_state_change(nh, ss, status, "to BYE", 
 			     nua_callstate_terminated);
 
-    if (du && 
-	(du->du_cr == NULL ||
-	 !nua_client_is_queued(du->du_cr) ||
-	 du->du_cr->cr_status >= 200)) {
-      /* INVITE is completed, we can zap the session... */;
-      cr->cr_usage = NULL;
-      nua_session_usage_destroy(nh, ss);
+    if (ss && !ss->ss_reporting) {
+      if (du->du_cr == NULL ||
+	  !nua_client_is_queued(du->du_cr) ||
+	  du->du_cr->cr_status >= 200) {
+	/* INVITE is completed, we can zap the session... */;
+	cr->cr_usage = NULL;
+	nua_session_usage_destroy(nh, ss);
+      }
     }
   }
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c	Fri Mar  7 14:20:27 2008
@@ -2078,7 +2078,6 @@
 
 void nua_client_request_complete(nua_client_request_t *cr)
 {
-  nua_client_request_remove(cr);
   if (cr && cr->cr_methods->crm_complete)
     cr->cr_methods->crm_complete(cr);
 }
@@ -2096,6 +2095,7 @@
 
   nua_destroy_signal(cr->cr_signal);
 
+  nua_client_request_remove(cr);
   nua_client_bind(cr, NULL);
   
   if (cr->cr_msg)
@@ -2104,6 +2104,7 @@
 
   if (cr->cr_orq)
     nta_outgoing_destroy(cr->cr_orq);
+
   cr->cr_orq = NULL;
 
   if (cr->cr_timer)



More information about the Freeswitch-svn mailing list