[Freeswitch-svn] [commit] r11804 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nea

FreeSWITCH SVN mikej at freeswitch.org
Wed Feb 11 08:51:14 PST 2009


Author: mikej
Date: Wed Feb 11 10:51:14 2009
New Revision: 11804

Log:
Thu Jan  8 15:03:28 CST 2009  Pekka Pessi <first.last at nokia.com>
  * nea: using <sofia-sip/su_string.h> functions



Modified:
   freeswitch/trunk/libs/sofia-sip/.update
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c

Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update	(original)
+++ freeswitch/trunk/libs/sofia-sip/.update	Wed Feb 11 10:51:14 2009
@@ -1 +1 @@
-Wed Feb 11 10:50:46 CST 2009
+Wed Feb 11 10:51:07 CST 2009

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea.c	Wed Feb 11 10:51:14 2009
@@ -39,6 +39,7 @@
 #include <assert.h>
 
 #include <sofia-sip/su_tagarg.h>
+#include <sofia-sip/su_string.h>
 
 #include <sofia-sip/sip.h>
 #include <sofia-sip/sip_header.h>
@@ -518,14 +519,14 @@
   nea->nea_notify_received = 1;
   nea->nea_callback(nea, nea->nea_context, sip);
 
-  if (strcasecmp(ss->ss_substate, "terminated") == 0) {
+  if (su_casematch(ss->ss_substate, "terminated")) {
     nta_leg_destroy(nea->nea_leg), nea->nea_leg = NULL;
     nea->nea_state = nea_terminated;
 
-    if (str0casecmp(ss->ss_reason, "deactivated") == 0) {
+    if (su_casematch(ss->ss_reason, "deactivated")) {
       nea->nea_state = nea_embryonic;
       nea->nea_deadline = sip_now();
-    } else if (str0casecmp(ss->ss_reason, "probation") == 0) {
+    } else if (su_casematch(ss->ss_reason, "probation")) {
       sip_time_t retry = sip_now() + NEA_TIMER_DELTA;
 
       if (ss->ss_retry_after)
@@ -541,9 +542,9 @@
       return 200;
     }
   }
-  else if (strcasecmp(ss->ss_substate, "pending") == 0)
+  else if (su_casematch(ss->ss_substate, "pending"))
     nea->nea_state = nea_pending;
-  else if (strcasecmp(ss->ss_substate, "active") == 0)
+  else if (su_casematch(ss->ss_substate, "active"))
     nea->nea_state = nea_active;
   else
     nea->nea_state = nea_extended;

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c	Wed Feb 11 10:51:14 2009
@@ -752,7 +752,7 @@
 
     /* Check if the payload type already exists */
     for (i = 0; (evv = ev->ev_views[i]); i++)
-      if (str0casecmp(cts, evv->evv_content_type->c_type) == 0)
+      if (su_casematch(cts, evv->evv_content_type->c_type))
 	break;
 
     if (private && evv == NULL) /* No private view without primary view. */
@@ -916,7 +916,7 @@
 
   /* Check if the payload type already exists */
   for (i = 0; ev->ev_views[i]; i++)
-    if (str0casecmp(content_type, ev->ev_views[i]->evv_content_type->c_type) == 0)
+    if (su_casematch(content_type, ev->ev_views[i]->evv_content_type->c_type))
       break;
 
   for (evv = ev->ev_views[i]; evv; evv = evv->evv_next)
@@ -1805,10 +1805,10 @@
 
 	type = evv->evv_content_type->c_type;
 
-	if ((strcasecmp(ac->ac_type, type) == 0) ||
-	    (strcasecmp(ac->ac_subtype, "*") == 0 &&
-	     strncasecmp(ac->ac_type, type,
-			 ac->ac_subtype - ac->ac_type) == 0)) {
+	if ((su_casematch(ac->ac_type, type)) ||
+	    (su_casematch(ac->ac_subtype, "*") &&
+	     su_casenmatch(ac->ac_type, type,
+			 ac->ac_subtype - ac->ac_type))) {
 	  if (evv_maybe == NULL)
 	    evv_maybe = evv;
 	}
@@ -2290,7 +2290,7 @@
 
   tl_gets(ta_args(ta), NEATAG_REASON_REF(reason), TAG_END());
 
-  rejected = reason && strcasecmp(reason, "rejected") == 0;
+  rejected = su_casematch(reason, "rejected");
 
   if (state == nea_terminated && embryonic && rejected && s->s_irq)
     retval = 0, s->s_rejected = 1;



More information about the Freeswitch-svn mailing list