[Freeswitch-svn] [commit] r11791 - freeswitch/trunk/libs/sofia-sip/tests
FreeSWITCH SVN
mikej at freeswitch.org
Wed Feb 11 08:45:24 PST 2009
Author: mikej
Date: Wed Feb 11 10:45:24 2009
New Revision: 11791
Log:
Thu Jan 8 12:13:05 CST 2009 Pekka Pessi <first.last at nokia.com>
* tests: using <sofia-sip/su_string.h> functions
Modified:
freeswitch/trunk/libs/sofia-sip/tests/test_call_reject.c
freeswitch/trunk/libs/sofia-sip/tests/test_cancel_bye.c
freeswitch/trunk/libs/sofia-sip/tests/test_nua.h
freeswitch/trunk/libs/sofia-sip/tests/test_proxy.c
Modified: freeswitch/trunk/libs/sofia-sip/tests/test_call_reject.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/tests/test_call_reject.c (original)
+++ freeswitch/trunk/libs/sofia-sip/tests/test_call_reject.c Wed Feb 11 10:45:24 2009
@@ -1254,7 +1254,7 @@
{
(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 @@
{
(void)arg;
- if (len >= 7 && strncasecmp(message, "ACK sip", 7) == 0)
+ if (len >= 7 && su_casenmatch(message, "ACK sip", 7))
return 0;
return len;
}
Modified: freeswitch/trunk/libs/sofia-sip/tests/test_cancel_bye.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/tests/test_cancel_bye.c (original)
+++ freeswitch/trunk/libs/sofia-sip/tests/test_cancel_bye.c Wed Feb 11 10:45:24 2009
@@ -945,7 +945,7 @@
{
(void)arg;
- if (strncasecmp(message, "ACK sip:", 8) == 0)
+ if (su_casenmatch(message, "ACK sip:", 8))
ack_sent++;
return len;
Modified: freeswitch/trunk/libs/sofia-sip/tests/test_nua.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/tests/test_nua.h (original)
+++ freeswitch/trunk/libs/sofia-sip/tests/test_nua.h Wed Feb 11 10:45:24 2009
@@ -50,6 +50,7 @@
#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__
Modified: freeswitch/trunk/libs/sofia-sip/tests/test_proxy.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/tests/test_proxy.c (original)
+++ freeswitch/trunk/libs/sofia-sip/tests/test_proxy.c Wed Feb 11 10:45:24 2009
@@ -688,7 +688,7 @@
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 @@
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 @@
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());
More information about the Freeswitch-svn
mailing list