Commit 12a4cbdd authored by Pekka Pessi's avatar Pekka Pessi
Browse files

nua: check_nua now uses s2base.h and s2sip.h

Ignore-this: f352be35d4bfcb306fad194d75c79fcb

darcs-hash:20090303181501-db55f-08cd9624c8d0ba1d63edbda1d9682a582cdc230d.gz
parent 85e4a3c8
......@@ -55,8 +55,6 @@ check_nua_SOURCES = check_nua.c check_nua.h \
check_nua_LDADD = $(nua_libs) ${top_builddir}/s2check/libs2.a \
@CHECK_LIBS@
check_nua_CFLAGS = $(CFLAGS) -I$(top_srcdir)/s2check
nua_libs = libnua.la \
../iptsec/libiptsec.la \
../ipt/libipt.la \
......@@ -84,6 +82,6 @@ EXTRA_DIST = nua.docs $(BUILT_SOURCES)
include $(top_srcdir)/rules/sofia.am
INCLUDES = ${INTERNAL_INCLUDES}
INCLUDES = ${INTERNAL_INCLUDES} -I$(top_srcdir)/s2check
TAG_DLL_FLAGS = LIST=nua_tag_list
......@@ -71,7 +71,7 @@ static void etsi_setup(void)
NUTAG_OUTBOUND("no-options-keepalive, no-validate"),
TAG_END());
soa = soa_create(NULL, s2->root, NULL);
soa = soa_create(NULL, s2base->root, NULL);
fail_if(!soa);
......@@ -148,7 +148,7 @@ respond_with_sdp(struct message *request,
fail_if(soa_get_local_sdp(soa, NULL, &body, &bodylen) != 1);
ta_start(ta, tag, value);
s2_respond_to(request, dialog, status, phrase,
s2_sip_respond_to(request, dialog, status, phrase,
SIPTAG_CONTENT_TYPE_STR("application/sdp"),
SIPTAG_PAYLOAD_STR(body),
SIPTAG_CONTENT_DISPOSITION_STR("session"),
......@@ -168,7 +168,7 @@ invite_sent_by_nua(nua_handle_t *nh,
fail_unless(s2_check_callstate(nua_callstate_calling));
return s2_wait_for_request(SIP_METHOD_INVITE);
return s2_sip_wait_for_request(SIP_METHOD_INVITE);
}
static void
......@@ -182,10 +182,10 @@ bye_by_nua(struct dialog *dialog, nua_handle_t *nh,
nua_bye(nh, ta_tags(ta));
ta_end(ta);
bye = s2_wait_for_request(SIP_METHOD_BYE);
bye = s2_sip_wait_for_request(SIP_METHOD_BYE);
fail_if(!bye);
s2_respond_to(bye, dialog, SIP_200_OK, TAG_END());
s2_free_message(bye);
s2_sip_respond_to(bye, dialog, SIP_200_OK, TAG_END());
s2_sip_free_message(bye);
fail_unless(s2_check_event(nua_r_bye, 200));
fail_unless(s2_check_callstate(nua_callstate_terminated));
}
......@@ -208,7 +208,7 @@ START_TEST(SIP_CC_OE_CE_V_019)
"sends an ACK request with a To header identical to the "
"received one for each received Success (200 OK) responses.");
nh = nua_handle(nua, NULL, SIPTAG_TO(s2->local), TAG_END());
nh = nua_handle(nua, NULL, SIPTAG_TO(s2sip->aor), TAG_END());
invite = invite_sent_by_nua(nh, TAG_END());
......@@ -218,17 +218,17 @@ START_TEST(SIP_CC_OE_CE_V_019)
fail_unless(s2_check_event(nua_r_invite, 200));
fail_unless(s2_check_callstate(nua_callstate_ready));
fail_unless(s2_check_request(SIP_METHOD_ACK));
fail_unless(s2_sip_check_request(SIP_METHOD_ACK));
respond_with_sdp(invite, d2, SIP_200_OK, TAG_END());
s2_free_message(invite);
s2_sip_free_message(invite);
fail_unless(s2_check_request(SIP_METHOD_ACK));
fail_unless(s2_sip_check_request(SIP_METHOD_ACK));
bye = s2_wait_for_request(SIP_METHOD_BYE);
bye = s2_sip_wait_for_request(SIP_METHOD_BYE);
fail_if(!bye);
s2_respond_to(bye, d2, SIP_200_OK, TAG_END());
s2_free_message(bye);
s2_sip_respond_to(bye, d2, SIP_200_OK, TAG_END());
s2_sip_free_message(bye);
bye_by_nua(d1, nh, TAG_END());
......@@ -248,39 +248,39 @@ START_TEST(SIP_CC_OE_CE_TI_008)
"that matches the transaction, still answer with an "
"ACK request until timer D set to at least 32 second expires.");
nh = nua_handle(nua, NULL, SIPTAG_TO(s2->local), TAG_END());
nh = nua_handle(nua, NULL, SIPTAG_TO(s2sip->aor), TAG_END());
invite = invite_sent_by_nua(nh, TAG_END());
s2_respond_to(invite, d1, 404, "First not found", TAG_END());
s2_sip_respond_to(invite, d1, 404, "First not found", TAG_END());
fail_unless(s2_check_event(nua_r_invite, 404));
fail_unless(s2_check_callstate(nua_callstate_terminated));
fail_unless(s2_check_request(SIP_METHOD_ACK));
fail_unless(s2_sip_check_request(SIP_METHOD_ACK));
s2_fast_forward(5, s2->root);
s2_nua_fast_forward(5, s2base->root);
s2_respond_to(invite, d1, 404, "Not found after 5 seconds", TAG_END());
fail_unless(s2_check_request(SIP_METHOD_ACK));
s2_sip_respond_to(invite, d1, 404, "Not found after 5 seconds", TAG_END());
fail_unless(s2_sip_check_request(SIP_METHOD_ACK));
s2_fast_forward(5, s2->root);
s2_nua_fast_forward(5, s2base->root);
s2_respond_to(invite, d1, 404, "Not found after 10 seconds", TAG_END());
fail_unless(s2_check_request(SIP_METHOD_ACK));
s2_sip_respond_to(invite, d1, 404, "Not found after 10 seconds", TAG_END());
fail_unless(s2_sip_check_request(SIP_METHOD_ACK));
s2_fast_forward(21, s2->root);
s2_nua_fast_forward(21, s2base->root);
s2_respond_to(invite, d1, 404, "Not found after 31 seconds", TAG_END());
fail_unless(s2_check_request(SIP_METHOD_ACK));
s2_sip_respond_to(invite, d1, 404, "Not found after 31 seconds", TAG_END());
fail_unless(s2_sip_check_request(SIP_METHOD_ACK));
s2_fast_forward(5, s2->root);
s2_nua_fast_forward(5, s2base->root);
/* Wake up nua thread and let it time out INVITE transaction */
nua_set_params(s2->nua, TAG_END());
s2_check_event(nua_r_set_params, 0);
s2_respond_to(invite, d1, 404, "Not found after 32 seconds", TAG_END());
s2_free_message(invite);
fail_if(s2_check_request_timeout(SIP_METHOD_ACK, 500));
s2_sip_respond_to(invite, d1, 404, "Not found after 32 seconds", TAG_END());
s2_sip_free_message(invite);
fail_if(s2_sip_check_request_timeout(SIP_METHOD_ACK, 3));
nua_handle_destroy(nh);
}
......@@ -299,7 +299,7 @@ START_TEST(SIP_CC_OE_CE_TI_011_012)
"on receipt of a retransmitted Success (200 OK) "
"responses does not send an ACK request.");
nh = nua_handle(nua, NULL, SIPTAG_TO(s2->local), TAG_END());
nh = nua_handle(nua, NULL, SIPTAG_TO(s2sip->aor), TAG_END());
invite = invite_sent_by_nua(nh, TAG_END());
......@@ -309,29 +309,29 @@ START_TEST(SIP_CC_OE_CE_TI_011_012)
fail_unless(s2_check_event(nua_r_invite, 200));
fail_unless(s2_check_callstate(nua_callstate_ready));
fail_unless(s2_check_request(SIP_METHOD_ACK));
fail_unless(s2_sip_check_request(SIP_METHOD_ACK));
s2_fast_forward(5, s2->root);
s2_nua_fast_forward(5, s2base->root);
respond_with_sdp(invite, d1, SIP_200_OK, TAG_END());
fail_unless(s2_check_request(SIP_METHOD_ACK));
fail_unless(s2_sip_check_request(SIP_METHOD_ACK));
s2_fast_forward(5, s2->root);
s2_nua_fast_forward(5, s2base->root);
respond_with_sdp(invite, d1, SIP_200_OK, TAG_END());
fail_unless(s2_check_request(SIP_METHOD_ACK));
fail_unless(s2_sip_check_request(SIP_METHOD_ACK));
s2_fast_forward(21, s2->root);
s2_nua_fast_forward(20, s2base->root);
respond_with_sdp(invite, d1, SIP_200_OK, TAG_END());
fail_unless(s2_check_request(SIP_METHOD_ACK));
fail_unless(s2_sip_check_request(SIP_METHOD_ACK));
s2_fast_forward(5, s2->root);
/* Stack times out the INVITE transaction */
s2_nua_fast_forward(5, s2base->root);
/* Wake up nua thread and let it time out INVITE transaction */
nua_set_params(s2->nua, TAG_END());
s2_check_event(nua_r_set_params, 0);
respond_with_sdp(invite, d1, SIP_200_OK, TAG_END());
s2_free_message(invite);
fail_if(s2_check_request_timeout(SIP_METHOD_ACK, 500));
respond_with_sdp(invite, d1, SIP_200_OK,
SIPTAG_SUBJECT_STR("Stray 200 OK"),
TAG_END());
s2_sip_free_message(invite);
mark_point();
fail_if(s2_sip_check_request_timeout(SIP_METHOD_ACK, 3));
bye_by_nua(d1, nh, TAG_END());
......
......@@ -33,6 +33,7 @@
#include "config.h"
#include "test_s2.h"
#include "check_nua.h"
#include <stdlib.h>
......@@ -43,8 +44,6 @@
#include <fnmatch.h>
#endif
#include "test_s2.h"
static void usage(int exitcode)
{
fprintf(exitcode ? stderr : stdout,
......@@ -62,6 +61,8 @@ int main(int argc, char *argv[])
s2_tester = "check_nua";
s2_suite("N2");
if (getenv("CHECK_NUA_VERBOSE"))
s2_start_stop = strtoul(getenv("CHECK_NUA_VERBOSE"), NULL, 10);
......
......@@ -75,7 +75,7 @@ static void pingpong_setup(void)
TPTAG_PINGPONG(20000),
TPTAG_KEEPALIVE(10000),
TAG_END());
tport_set_params(s2->tcp.tport, TPTAG_PONG2PING(1), TAG_END());
tport_set_params(s2sip->tcp.tport, TPTAG_PONG2PING(1), TAG_END());
}
static void pingpong_thread_setup(void)
......@@ -121,12 +121,12 @@ START_TEST(register_1_0_1)
nua_register(nh, TAG_END());
fail_unless((m = s2_wait_for_request(SIP_METHOD_REGISTER)) != NULL, NULL);
fail_unless((m = s2_sip_wait_for_request(SIP_METHOD_REGISTER)) != NULL, NULL);
s2_respond_to(m, NULL,
s2_sip_respond_to(m, NULL,
SIP_403_FORBIDDEN,
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
nua_handle_destroy(nh);
......@@ -156,38 +156,38 @@ START_TEST(register_1_1_2)
nua_register(nh, TAG_END());
m = s2_wait_for_request(SIP_METHOD_REGISTER); fail_if(!m);
s2_respond_to(m, NULL,
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER); fail_if(!m);
s2_sip_respond_to(m, NULL,
SIP_407_PROXY_AUTH_REQUIRED,
SIPTAG_PROXY_AUTHENTICATE_STR(s2_auth_digest_str),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
s2_check_event(nua_r_register, 407);
nua_authenticate(nh, NUTAG_AUTH(s2_auth_credentials), TAG_END());
m = s2_wait_for_request(SIP_METHOD_REGISTER); fail_if(!m);
s2_respond_to(m, NULL,
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER); fail_if(!m);
s2_sip_respond_to(m, NULL,
SIP_401_UNAUTHORIZED,
SIPTAG_WWW_AUTHENTICATE_STR(s2_auth2_digest_str),
SIPTAG_PROXY_AUTHENTICATE_STR(s2_auth_digest_str),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
s2_check_event(nua_r_register, 401);
nua_authenticate(nh, NUTAG_AUTH(s2_auth2_credentials), TAG_END());
m = s2_wait_for_request(SIP_METHOD_REGISTER);
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER);
fail_if(!m);
fail_if(!m->sip->sip_authorization);
fail_if(!m->sip->sip_proxy_authorization);
s2_save_register(m);
s2_respond_to(m, NULL,
s2_sip_respond_to(m, NULL,
SIP_200_OK,
SIPTAG_CONTACT(s2->registration->contact),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
assert(s2->registration->contact != NULL);
s2_check_event(nua_r_register, 200);
......@@ -237,32 +237,32 @@ START_TEST(register_1_2_1) {
nua_register(nh, TAG_END());
m = s2_wait_for_request(SIP_METHOD_REGISTER);
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER);
fail_if(!m);
fail_if(!m->sip->sip_contact || m->sip->sip_contact->m_next);
s2_save_register(m);
s2_respond_to(m, NULL,
s2_sip_respond_to(m, NULL,
SIP_200_OK,
SIPTAG_CONTACT(s2->registration->contact),
SIPTAG_VIA(natted_via(m)),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
assert(s2->registration->contact != NULL);
s2_check_event(nua_r_register, 100);
m = s2_wait_for_request(SIP_METHOD_REGISTER);
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER);
fail_if(!m);
fail_if(!m->sip->sip_contact || !m->sip->sip_contact->m_next);
s2_save_register(m);
s2_respond_to(m, NULL,
s2_sip_respond_to(m, NULL,
SIP_200_OK,
SIPTAG_CONTACT(s2->registration->contact),
SIPTAG_VIA(natted_via(m)),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
fail_unless(s2->registration->contact != NULL);
fail_if(s2->registration->contact->m_next != NULL);
......@@ -286,19 +286,19 @@ static nua_handle_t *make_auth_natted_register(
nua_register(nh, ta_tags(ta));
ta_end(ta);
m = s2_wait_for_request(SIP_METHOD_REGISTER); fail_if(!m);
s2_respond_to(m, NULL,
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER); fail_if(!m);
s2_sip_respond_to(m, NULL,
SIP_401_UNAUTHORIZED,
SIPTAG_WWW_AUTHENTICATE_STR(s2_auth_digest_str),
SIPTAG_VIA(natted_via(m)),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
s2_check_event(nua_r_register, 401);
nua_authenticate(nh, NUTAG_AUTH(s2_auth_credentials), TAG_END());
m = s2_wait_for_request(SIP_METHOD_REGISTER);
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER);
fail_if(!m);
fail_if(!m->sip->sip_authorization);
/* should not unregister the previous contact
......@@ -307,12 +307,12 @@ static nua_handle_t *make_auth_natted_register(
fail_if(m->sip->sip_contact->m_next);
s2_save_register(m);
s2_respond_to(m, NULL,
s2_sip_respond_to(m, NULL,
SIP_200_OK,
SIPTAG_CONTACT(s2->registration->contact),
SIPTAG_VIA(natted_via(m)),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
assert(s2->registration->contact != NULL);
s2_check_event(nua_r_register, 200);
......@@ -350,61 +350,61 @@ START_TEST(register_1_2_2_2)
mark_point();
m = s2_wait_for_request(SIP_METHOD_OPTIONS);
m = s2_sip_wait_for_request(SIP_METHOD_OPTIONS);
fail_if(!m);
s2_respond_to(m, NULL,
s2_sip_respond_to(m, NULL,
SIP_407_PROXY_AUTH_REQUIRED,
SIPTAG_VIA(natted_via(m)),
SIPTAG_PROXY_AUTHENTICATE_STR(s2_auth_digest_str),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
mark_point();
m = s2_wait_for_request(SIP_METHOD_OPTIONS);
m = s2_sip_wait_for_request(SIP_METHOD_OPTIONS);
fail_if(!m); fail_if(!m->sip->sip_proxy_authorization);
s2_respond_to(m, NULL,
s2_sip_respond_to(m, NULL,
SIP_200_OK,
SIPTAG_VIA(natted_via(m)),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
su_root_step(s2->root, 20); su_root_step(s2->root, 20);
s2_fast_forward(120, s2->root); /* Default keepalive interval */
su_root_step(s2base->root, 20); su_root_step(s2base->root, 20);
s2_nua_fast_forward(120, s2base->root); /* Default keepalive interval */
mark_point();
m = s2_wait_for_request(SIP_METHOD_OPTIONS);
s2_respond_to(m, NULL,
m = s2_sip_wait_for_request(SIP_METHOD_OPTIONS);
s2_sip_respond_to(m, NULL,
SIP_200_OK,
SIPTAG_VIA(natted_via(m)),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
su_root_step(s2->root, 20); su_root_step(s2->root, 20);
s2_fast_forward(120, s2->root); /* Default keepalive interval */
su_root_step(s2base->root, 20); su_root_step(s2base->root, 20);
s2_nua_fast_forward(120, s2base->root); /* Default keepalive interval */
mark_point();
receive_natted = "received=4.255.255.10";
m = s2_wait_for_request(SIP_METHOD_OPTIONS);
s2_respond_to(m, NULL,
m = s2_sip_wait_for_request(SIP_METHOD_OPTIONS);
s2_sip_respond_to(m, NULL,
SIP_200_OK,
SIPTAG_VIA(natted_via(m)),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
s2_check_event(nua_i_outbound, 0);
m = s2_wait_for_request(SIP_METHOD_REGISTER);
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER);
fail_if(!m); fail_if(!m->sip->sip_authorization);
fail_if(!m->sip->sip_contact || !m->sip->sip_contact->m_next);
s2_save_register(m);
s2_respond_to(m, NULL,
s2_sip_respond_to(m, NULL,
SIP_200_OK,
SIPTAG_CONTACT(s2->registration->contact),
SIPTAG_VIA(natted_via(m)),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
s2_check_event(nua_r_register, 200);
......@@ -434,33 +434,33 @@ START_TEST(register_1_2_2_3)
receive_natted = "received=4.255.255.10";
s2_fast_forward(3600, s2->root);
s2_nua_fast_forward(3600, s2base->root);
mark_point();
m = s2_wait_for_request(SIP_METHOD_REGISTER);
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER);
fail_if(!m); fail_if(!m->sip->sip_authorization);
s2_save_register(m);
s2_respond_to(m, NULL,
s2_sip_respond_to(m, NULL,
SIP_200_OK,
SIPTAG_CONTACT(s2->registration->contact),
SIPTAG_VIA(natted_via(m)),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
s2_check_event(nua_r_register, 100);
m = s2_wait_for_request(SIP_METHOD_REGISTER);
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER);
fail_if(!m); fail_if(!m->sip->sip_authorization);
fail_if(!m->sip->sip_contact || !m->sip->sip_contact->m_next);
s2_save_register(m);
s2_respond_to(m, NULL,
s2_sip_respond_to(m, NULL,
SIP_200_OK,
SIPTAG_CONTACT(s2->registration->contact),
SIPTAG_VIA(natted_via(m)),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
fail_unless(s2->registration->contact != NULL);
fail_if(s2->registration->contact->m_next != NULL);
......@@ -484,28 +484,28 @@ START_TEST(register_1_2_3) {
mark_point();
m = s2_wait_for_request(SIP_METHOD_REGISTER);
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER);
fail_if(!m);
fail_if(!m->sip->sip_contact || m->sip->sip_contact->m_next);
s2_respond_to(m, NULL,
s2_sip_respond_to(m, NULL,
400, "Bad Contact",
SIPTAG_VIA(natted_via(m)),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
s2_check_event(nua_r_register, 100);
m = s2_wait_for_request(SIP_METHOD_REGISTER);
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER);
fail_if(!m);
s2_save_register(m);
s2_respond_to(m, NULL,
s2_sip_respond_to(m, NULL,
SIP_200_OK,
SIPTAG_CONTACT(s2->registration->contact),
SIPTAG_VIA(natted_via(m)),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
fail_unless(s2->registration->contact != NULL);
fail_if(s2->registration->contact->m_next != NULL);
......@@ -530,34 +530,34 @@ START_TEST(register_1_3_1)
nh = nua_handle(nua, NULL, TAG_END());
nua_register(nh, NUTAG_PROXY(s2->tcp.contact->m_url), TAG_END());
nua_register(nh, NUTAG_PROXY(s2sip->tcp.contact->m_url), TAG_END());
m = s2_wait_for_request(SIP_METHOD_REGISTER);
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER);
fail_if(!m); fail_if(!m->sip->sip_contact || m->sip->sip_contact->m_next);
fail_if(!tport_is_tcp(m->tport));
s2_save_register(m);
s2_respond_to(m, NULL,
s2_sip_respond_to(m, NULL,
SIP_200_OK,
SIPTAG_CONTACT(s2->registration->contact),
SIPTAG_VIA(natted_via(m)),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
assert(s2->registration->contact != NULL);
s2_check_event(nua_r_register, 100);
m = s2_wait_for_request(SIP_METHOD_REGISTER);
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER);
fail_if(!m);
fail_if(!m->sip->sip_contact || !m->sip->sip_contact->m_next);
s2_save_register(m);
s2_respond_to(m, NULL,
s2_sip_respond_to(m, NULL,
SIP_200_OK,
SIPTAG_CONTACT(s2->registration->contact),
SIPTAG_VIA(natted_via(m)),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
fail_unless(s2->registration->contact != NULL);
fail_if(s2->registration->contact->m_next != NULL);
......@@ -581,7 +581,7 @@ START_TEST(register_1_3_2_1)
mark_point();
s2->registration->nh = nh;
make_auth_natted_register(nh, NUTAG_PROXY(s2->tcp.contact->m_url), TAG_END());
make_auth_natted_register(nh, NUTAG_PROXY(s2sip->tcp.contact->m_url), TAG_END());
fail_if(!tport_is_tcp(s2->registration->tport));
s2_register_teardown();
}
......@@ -604,38 +604,38 @@ START_TEST(register_1_3_2_2)
mark_point();
s2->registration->nh = nh;
make_auth_natted_register(
nh, NUTAG_PROXY(s2->tcp.contact->m_url),
nh, NUTAG_PROXY(s2sip->tcp.contact->m_url),
NUTAG_OUTBOUND("no-options-keepalive, no-validate"),
TAG_END());
fail_if(!tport_is_tcp(s2->registration->tport));
tport_shutdown(s2->registration->tport, 2);
m = s2_wait_for_request(SIP_METHOD_REGISTER);
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER);
fail_if(!m); fail_if(!m->sip->sip_authorization);
s2_save_register(m);
s2_respond_to(m, NULL,
s2_sip_respond_to(m, NULL,
SIP_200_OK,
SIPTAG_CONTACT(s2->registration->contact),
SIPTAG_VIA(natted_via(m)),
TAG_END());
s2_free_message(m);
s2_sip_free_message(m);
/* The "NAT binding" changed when new TCP connection is established */
/* => NUA re-REGISTERs with newly detected contact */
s2_check_event(nua_r_register, 100);
m = s2_wait_for_request(SIP_METHOD_REGISTER);
m = s2_sip_wait_for_request(SIP_METHOD_REGISTER);
fail_if(!m); fail_if(!m->sip->sip_authorization);
fail_if(!m->