Commit b3bc6335 authored by Pekka Pessi's avatar Pekka Pessi

test_nua: using rudimentary outbound support in B's proxy.

darcs-hash:20070725164251-65a35-ea48adb350c2de048816d9c06b5bbee3bd38dd1d.gz
parent 09e1c16a
......@@ -1522,8 +1522,6 @@ int test_bye_to_invalid_contact(struct context *ctx)
TEST_1(e = b->events->head); TEST_E(e->data->e_event, nua_r_bye);
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_terminated); /* TERMINATED */
TEST_1(!e->next);
free_events_in_list(ctx, b->events);
TEST_1(!nua_handle_has_active_call(b_call->nh));
TEST_1(nua_handle_has_active_call(a_call->nh));
......@@ -1534,19 +1532,21 @@ int test_bye_to_invalid_contact(struct context *ctx)
if (print_headings)
printf("TEST NUA-6.4.3: PASSED\n");
if (!ctx->p)
if (!ctx->p) {
free_events_in_list(ctx, b->events);
return 0;
}
if (print_headings)
printf("TEST NUA-6.4.4: Wait for re-REGISTER after connection has been closed\n");
/* B is supposed to re-register pretty soon, wait for re-registration */
run_b_until(ctx, -1, save_until_final_response);
if (!e->next || (!e->next->next || !e->next->data->e_status != 200))
/* B is supposed to re-register pretty soon, wait for re-registration */
run_b_until(ctx, -1, save_until_final_response);
seen_401 = 0;
for (e = b->events->head; e; e = e->next) {
for (e = e->next; e; e = e->next) {
TEST_E(e->data->e_event, nua_r_register);
TEST_1(sip = sip_object(e->data->e_msg));
......
......@@ -136,6 +136,8 @@ int test_nua_init(struct context *ctx,
AUTHTAG_NEXT_EXPIRES(60),
TAG_END());
test_proxy_domain_set_outbound(ctx->b.domain, 1);
ctx->c.domain =
test_proxy_add_domain(ctx->p,
URL_STRING_MAKE("sip:example.net")->us_url,
......
......@@ -64,6 +64,11 @@ void test_proxy_get_session_timer(struct proxy *p,
void test_proxy_domain_set_authorize(struct domain *d, int authorize);
void test_proxy_domain_get_authorize(struct domain *d, int *return_authorize);
void test_proxy_domain_set_outbound(struct domain *d,
int use_outbound);
void test_proxy_domain_get_outbound(struct domain *d,
int *return_use_outbound);
int test_proxy_close_tports(struct proxy *p);
SOFIA_END_DECLS
......
......@@ -814,6 +814,7 @@ static
size_t change_status_to_483(void *a, void *message, size_t len);
int save_until_notified_and_responded_twice(CONDITION_PARAMS);
int save_until_notify_responded_twice(CONDITION_PARAMS);
int accept_subscription_until_terminated(CONDITION_PARAMS);
int test_subscribe_notify_graceful(struct context *ctx)
{
......@@ -902,7 +903,7 @@ int test_subscribe_notify_graceful(struct context *ctx)
SUBSCRIBE(a, a_call, a_call->nh, TAG_END());
run_ab_until(ctx, -1, save_until_notified_and_responded_twice,
-1, save_until_notify_responded_twice);
-1, accept_subscription_until_terminated);
#if 0
/* Client events:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment