]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Thu Jan 8 12:13:05 CST 2009 Pekka Pessi <first.last@nokia.com>
authorMichael Jerris <mike@jerris.com>
Wed, 11 Feb 2009 16:45:24 +0000 (16:45 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 11 Feb 2009 16:45:24 +0000 (16:45 +0000)
  * tests: using <sofia-sip/su_string.h> functions

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11791 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/sofia-sip/tests/test_call_reject.c
libs/sofia-sip/tests/test_cancel_bye.c
libs/sofia-sip/tests/test_nua.h
libs/sofia-sip/tests/test_proxy.c

index 7e10c6e090b8a3cd9763f08aee1f9e25150aed50..672ec3c21fd7f0a8a03224ecc7bbaa261be7833d 100644 (file)
@@ -1254,7 +1254,7 @@ size_t filter_200_OK(void *arg, void *message, size_t len)
 {
   (void)arg;
 
-  if (len >= 11 && strncasecmp(message, "SIP/2.0 200", 11) == 0)
+  if (len >= 11 && su_casenmatch(message, "SIP/2.0 200", 11))
     return 0;
   return len;
 }
@@ -1263,7 +1263,7 @@ size_t filter_ACK(void *arg, void *message, size_t len)
 {
   (void)arg;
 
-  if (len >= 7 && strncasecmp(message, "ACK sip", 7) == 0)
+  if (len >= 7 && su_casenmatch(message, "ACK sip", 7))
     return 0;
   return len;
 }
index 7ba63cad105e484972d84f02fa58000d34e055aa..f1882f4f1f13894f2d506308379f6696ad0d8d2b 100644 (file)
@@ -945,7 +945,7 @@ size_t count_acks(void *arg, void *message, size_t len)
 {
   (void)arg;
 
-  if (strncasecmp(message, "ACK sip:", 8) == 0)
+  if (su_casenmatch(message, "ACK sip:", 8))
     ack_sent++;
 
   return len;
index 940db657eb039c3da748bbf626b92baf9da13408..1890316f25948fdb2a6ae1caa6fcdf42216d4bfb 100644 (file)
@@ -50,6 +50,7 @@ struct call;
 #include <sofia-sip/su_log.h>
 #include <sofia-sip/su_tagarg.h>
 #include <sofia-sip/su_tag_io.h>
+#include <sofia-sip/su_string.h>
 #include <sofia-sip/nua_tag.h>
 
 #if __APPLE_CC__
index 4647bffa9f1cd276caf293e6eb1c42bdaa548328..51fd3f5e02c39d37abca5863bcc597807376fa20 100644 (file)
@@ -688,7 +688,7 @@ static sip_contact_t *create_transport_contacts(struct proxy *p)
     char const *proto = v->v_protocol;
 
     if (v->v_next &&
-       strcasecmp(v->v_host, v->v_next->v_host) == 0 &&
+       su_casematch(v->v_host, v->v_next->v_host) &&
        str0cmp(v->v_port, v->v_next->v_port) == 0 &&
        ((proto == sip_transport_udp &&
          v->v_next->v_protocol == sip_transport_tcp) ||
@@ -861,7 +861,7 @@ static int originating_transaction(struct proxy_tr *t)
     return 0;
 
   for (o = t->proxy->domains; o; o = o->next)
-    if (strcasecmp(host, o->uri->url_host) == 0)
+    if (su_casematch(host, o->uri->url_host))
       break;
 
   t->origin = o;
@@ -1286,7 +1286,7 @@ static int check_received_contact(struct proxy_tr *t)
   sip_via_t *v = sip->sip_via;
 
   if (m && v && v->v_received && m->m_url->url_host
-      && strcasecmp(v->v_received, m->m_url->url_host)
+      && !su_casematch(v->v_received, m->m_url->url_host)
       && host_is_ip_address(m->m_url->url_host))
     return respond_transaction(t, 406, "Unacceptable Contact", TAG_END());