diff --git a/libs/sofia-sip/tests/test_call_reject.c b/libs/sofia-sip/tests/test_call_reject.c index 7e10c6e090..672ec3c21f 100644 --- a/libs/sofia-sip/tests/test_call_reject.c +++ b/libs/sofia-sip/tests/test_call_reject.c @@ -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; } diff --git a/libs/sofia-sip/tests/test_cancel_bye.c b/libs/sofia-sip/tests/test_cancel_bye.c index 7ba63cad10..f1882f4f1f 100644 --- a/libs/sofia-sip/tests/test_cancel_bye.c +++ b/libs/sofia-sip/tests/test_cancel_bye.c @@ -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; diff --git a/libs/sofia-sip/tests/test_nua.h b/libs/sofia-sip/tests/test_nua.h index 940db657eb..1890316f25 100644 --- a/libs/sofia-sip/tests/test_nua.h +++ b/libs/sofia-sip/tests/test_nua.h @@ -50,6 +50,7 @@ struct call; #include #include #include +#include #include #if __APPLE_CC__ diff --git a/libs/sofia-sip/tests/test_proxy.c b/libs/sofia-sip/tests/test_proxy.c index 4647bffa9f..51fd3f5e02 100644 --- a/libs/sofia-sip/tests/test_proxy.c +++ b/libs/sofia-sip/tests/test_proxy.c @@ -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());