Commit 329c432e authored by Pekka Pessi's avatar Pekka Pessi

Renumbered test cases, state transitions in nua.docs and test_nua.c.

darcs-hash:20051130121954-65a35-41dc2cbac95199cc7d688f57c1a730ed4dfef8b4.gz
parent 5c9981ee
......@@ -382,7 +382,7 @@ typedef union operation
... /* call-related information */
} call;
struct
struct
{
nua_handle_t *handle; /* operation handle /
... /* subscription-related information */
......@@ -811,8 +811,8 @@ void app_i_message(int status,
TAG_NULL());
...
oper->handle = nua_handle(app->nua, app,
NUTAG_URL(to->a_url),
oper->handle = nua_handle(app->nua, app,
NUTAG_URL(to->a_url),
SIPTAG_TO(to),
ta_tags(ta));
...
......@@ -843,13 +843,13 @@ void app_callback(nua_event_t event,
switch (event) {
case nua_i_subscription:
tl_gets(tags,
tl_gets(tags,
NEATAG_SUB_REF(subscriber),
TAG_END());
nua_authorize(nua_substate_active);
default:
break;
......@@ -984,56 +984,56 @@ not include the extensions like @b 100rel or @b UPDATE.
|
V
+------------+
| |---------------------------------------+
| |----+ |
+------| CALLING | (7a) nua_cancel/CANCEL |
| | |<---+ |
| | | |
| +------------+ |
| | |
| (2) 18X/- |
| | |
| V |
| +------------+ |
| | |-------------------------------------->|
| | |----+ |
| | PROCEEDING | (7b) nua_cancel/CANCEL |
| | |<---+ |
| | |----------------------+ |
| +------------+ | |
| | | |
(3b) 2XX/- (3a) 2XX/- | (6) [3456]XX/ACK
| | | |
| V | |
| + - - - - - -+ | |
+----->: : | |
: COMPLETING :-------+ | |
+ - - -: : | | |
: + - - - - - -+ | | |
: | | | |
:<auto_ack> | | | |
:or nua_ack | <auto_ack> | | |
:and media | or nua_ack | nua_bye | |
(5) error (4) /ACK (9) /ACK+BYE (8) nua_bye/BYE |
: /ACK+BYE | | | |
: V | | |
: +------------+ | | |
: | | | | |
: | READY | | | |
: | | | | |
: +------------+ | | |
: | | |
| | | |
: | | |
: +-------------+ | | |
+ - - >| TERMINATING |<-----+<-------------+ |
+-------------+ |
| |
| [23456]XX/- |
| |
V |
+------------+ |
| TERMINATED |<--------------------------------------+
| |-----------------------------(6a)-----+
| |----+ |
+------| CALLING | (7a) nua_cancel/CANCEL |
| | |<---+ |
| | | |
| +------------+ |
| | |
| (2) 18X/- |
| | |
| V |
| +------------+ |
| | |-----------------------------(6b)---->|
| | |----+ |
| | PROCEEDING | (7b) nua_cancel/CANCEL |
| | |<---+ |
| | |----------------------+ |
| +------------+ | |
| | | |
(3a) 2XX/- (3b) 2XX/- | (6) [3456]XX/ACK
| | | |
| V | |
| + - - - - - -+ | |
+----->: : | |
: COMPLETING :-------+ | |
+ - - -: : | | |
: + - - - - - -+ | | |
: | | | |
:<auto_ack> | | | |
:or nua_ack | <auto_ack> | | |
:and media | or nua_ack | nua_bye | |
(5) error (4) /ACK (9) /ACK+BYE (8) nua_bye/BYE |
: /ACK+BYE | | | |
: V | | |
: +------------+ | | |
: | | | | |
: | READY | | | |
: | | | | |
: +------------+ | | |
: | | |
| | | |
: | | |
: +-------------+ | | |
+ - - >| TERMINATING |<-----+<-------------+ |
+-------------+ |
| |
| [23456]XX/- |
| |
V |
+------------+ |
| TERMINATED |<-------------------------------------+
+------------+
@endcode
......@@ -1071,7 +1071,7 @@ follows:
announcements about call progress using the early media session.
</td></tr>
<tr><td>C3a</td>
<td>proceeding</td><td rowspan="2">2XX</td>
<td>calling</td><td rowspan="2">2XX</td>
<td rowspan="2">-</td><td rowspan="2">completing</td>
<td rowspan="2">Save answer</td>
<td rowspan="2">
......@@ -1084,7 +1084,7 @@ follows:
proceeds immediately to next state transition.
</td></tr>
<tr><td>C3b</td>
<td>calling</td></tr>
<td>proceeding</td></tr>
<tr><td>C4</td>
<td>completing</td>
<td>nua_ack() or<br>@ref NUTAG_AUTOACK() "auto-ack" </td>
......@@ -1189,7 +1189,7 @@ not include the extensions like @b 100rel or @b UPDATE.
| | +----------| | | :
| | | +------------+ | :
| nua_respond/ | | | :
(6) /[3456]XX | nua_respond/2XX (3a) (3b) :
(6) /[3456]XX | nua_respond/2XX (3b) (3a) :
| | | | | :
| | | V V V
| | | +-------------+
......@@ -1269,7 +1269,7 @@ follows:
180 Ringing immediately after receiving INVITE and enters @b early state.
</td></tr>
<tr><td>S3a</td> <!-- transition -->
<td>early</td> <!-- previous state -->
<td>received</td> <!-- previous state -->
<td rowspan=2>nua_respond()</td> <!-- input -->
<td rowspan=2>2XX</td> <!-- output -->
<td rowspan=3>completed</td> <!-- next state -->
......@@ -1281,7 +1281,7 @@ follows:
should be included in the 2XX response.
</td></tr>
<tr><td>S3b</td> <!-- transition -->
<td>received</td> <!-- previous state -->
<td>early</td> <!-- previous state -->
</td></tr>
<tr><td>S3c</td> <!-- transition -->
<td>init</td> <!-- previous state -->
......@@ -1627,7 +1627,7 @@ SIP use cases.
@section nua_event_diagram_call Basic Call
The SIP following event diagram shows a pretty simple, succesful call case.
The SIP following event diagram shows a pretty simple, succesful call case.
The nua events and nua function calls are show in the diagram below as well
as the SIP messages.
......@@ -1645,10 +1645,10 @@ NUTAG_AUTOANSWER(0) on B side, NUTAG_AUTOACK(0) on A side.
5 |<--100 Trying---| | -> nua_i_state
6 | | |
7 | | |
8 | | |
8 | | |
9 | |<--180 Ringing--| <- nua_respond(180)
10 nua_i_invite <- |<--180 Ringing--| | -> nua_i_state
11 nua_i_state <- | | |
11 nua_i_state <- | | |
12 | |<--200 OK-------| <- nua_respond(200)
13 nua_i_invite <- |<---200 OK------| | -> nua_i_state
14 nua_i_state <- | | |
......@@ -1679,16 +1679,16 @@ request sent on existing SIP session. Both original caller and callee can
send re-INVITEs. The main use of re-INVITE is modifying sessions: adding
media lines to the session, changing codecs on existing media, and, as you
might expect, putting existing media on hold as well as resuming media from
hold.
hold.
A re-INVITE is sent by calling nua_invite() on handle with existing call.
A re-INVITE is sent by calling nua_invite() on handle with existing call.
When putting call on hold, the application can include SOATAG_HOLD("audio")
or SOATAG_HOLD("video") or SOATAG_HOLD("audio, video") or SOATAG_HOLD("*")
as parameters to re-INVITE nua_invite(). (Note that last SOATAG_HOLD() in
the tag list will override the SOATAG_HOLD() tags before it.)
Another feature where nua tries to be helpful is autoanswer and auto-ACK on
existing sessions: the re-INVITE is automatically responded with <i>200 OK</i>
existing sessions: the re-INVITE is automatically responded with <i>200 OK</i>
and ACK is automatically sent. (If the application wants to respond and ACK
by itself, it should explicitly set NUTAG_AUTOANSWER(0) and/or
NUTAG_AUTOACK(0) in the handle; either include them in nua_invite() or
......@@ -1704,10 +1704,10 @@ nua_respond() parameters or call nua_set_hparams() explicitly.
5 |<--100 Trying---| | -> nua_i_state
6 | | |
7 | | |
8 | | |
8 | | |
9 | |<--180 Ringing--| <- nua_respond(180)
10 nua_i_invite <- |<--180 Ringing--| | -> nua_i_state
11 nua_i_state <- | | |
11 nua_i_state <- | | |
12 | |<--200 OK-------| <- nua_respond(200)
13 nua_i_invite <- |<---200 OK------| | -> nua_i_state
14 nua_i_state <- | | |
......@@ -1717,18 +1717,18 @@ nua_respond() parameters or call nua_set_hparams() explicitly.
18 | | |
19 <<== Bi-Directional RTP Established ==>>
20 | | |
21 | | |
21 | | |
22 | |<--INVITE(hold)-| <- nua_invite(..
21 | | | NUTAG_HOLD("*")..)
23 nua_i_invite <- |<-INVITE(hold)--| | -> nua_i_state
25 nua_i_state <- |----200 OK----->| |
26 | |----200 OK----->| -> nua_i_invite
28 | |<-----ACK-------| -> nua_i_state
29 nua_i_ack <- |<----ACK--------| |
29 nua_i_ack <- |<----ACK--------| |
24 | | |
30 <<== Uni-Directional RTP Established ==>>
24 | | |
31 | | |
31 | | |
32 | |<--INVITE-------| <- nua_invite(..
21 | | | NUTAG_HOLD(NULL)..)
33 nua_i_invite <- |<--INVITE-------| | -> nua_i_state
......@@ -1750,7 +1750,7 @@ nua_respond() parameters or call nua_set_hparams() explicitly.
@section nua_event_diagram_call_transfer Call Transfer
This is the unattended call transfer case.
This is the unattended call transfer case.
1st MSC showing Alice's end:
......@@ -1787,7 +1787,7 @@ This is the unattended call transfer case.
24 nua_r_bye <- |<----200 OK---------| |
25 nua_i_state <- | No RTP Session | |
28 | |<----180 Ringing----|
26 nua_i_notify <- |<- - -NOTIFY - - - -| |
26 nua_i_notify <- |<- - -NOTIFY - - - -| |
27 | | |
20 |- - - 200 OK- - - ->| |
29 | | |
......@@ -1832,7 +1832,7 @@ This is the unattended call transfer case.
22 |-------BYE--------->| -> nua_i_bye | |
23 | | -> nua_i_state | |
24 |<----200 OK---------| nua_handle() -> | |
25 | No RTP Session | nua_invite() -> | |
25 | No RTP Session | nua_invite() -> | |
26 | | |--INVITE("b: A")--->|
27 | | | |
28 | | nua_i_invite <- |<--180 Ringing------|
......@@ -1844,10 +1844,10 @@ This is the unattended call transfer case.
34 | | |<=======RTP========>|
35 | | | |
36 |<-----NOTIFY--------| | |
37 | |
38 |------200 OK------->| -> nua_r_notify
37 | |
38 |------200 OK------->| -> nua_r_notify
39 | | <- nua_handle_destroy
| |
| |
@endcode
Bob includes nh1 in nua_invite()/25 as NUTAG_NOTIFY_REFER() parameter.
......
......@@ -3544,6 +3544,9 @@ ua_invite2(nua_t *nua, nua_handle_t *nh, nua_event_t e, int restarted,
char const *what;
if (ss->ss_state == nua_callstate_terminated)
ss->ss_state = nua_callstate_init;
du = dialog_usage_add(nh, nh->nh_ds, nua_session_usage, NULL);
what = nua_500_error; /* Internal error */
......
......@@ -63,6 +63,7 @@ struct call;
extern su_log_t nua_log[];
extern su_log_t soa_log[];
extern su_log_t nea_log[];
extern su_log_t nta_log[];
extern su_log_t tport_log[];
extern su_log_t su_log_default[];
......@@ -667,7 +668,7 @@ int test_params(struct context *ctx)
su_home_auto(tmphome, sizeof(tmphome));
if (print_headings)
printf("TEST NUA-2.0: PARAMETERS\n");
printf("TEST NUA-1.1: PARAMETERS\n");
ctx->root = su_root_create(NULL); TEST_1(ctx->root);
......@@ -1038,14 +1039,14 @@ int test_params(struct context *ctx)
su_home_deinit(tmphome);
if (print_headings)
printf("TEST NUA-2.0: PASSED\n");
printf("TEST NUA-1.1: PASSED\n");
END();
}
/* ======================================================================== */
int test_init(struct context *ctx, char *argv[])
int test_init(struct context *ctx, int start_proxy, url_t const *o_proxy)
{
BEGIN();
struct event *e;
......@@ -1057,19 +1058,21 @@ int test_init(struct context *ctx, char *argv[])
/* Disable threading by command line switch? */
su_root_threading(ctx->root, ctx->threading);
if (print_headings)
printf("TEST NUA-3.0.0: init proxy P\n");
if (start_proxy && !o_proxy) {
if (print_headings)
printf("TEST NUA-2.0.0: init proxy P\n");
ctx->p = test_proxy_create(ctx->root);
ctx->p = test_proxy_create(ctx->root);
if (print_headings)
printf("TEST NUA-3.0.0: PASSED\n");
if (print_headings)
printf("TEST NUA-2.0.0: PASSED\n");
}
if (print_headings)
printf("TEST NUA-3.0.1: init endpoint A\n");
printf("TEST NUA-2.0.1: init endpoint A\n");
ctx->a.nua = nua_create(ctx->root, a_callback, ctx,
NUTAG_PROXY(ctx->p->uri),
NUTAG_PROXY(ctx->p ? ctx->p->uri : o_proxy),
SIPTAG_FROM_STR("sip:alice@example.com"),
NUTAG_URL("sip:0.0.0.0:*"),
SOATAG_USER_SDP_STR("m=audio 5004 RTP/AVP 0 8"),
......@@ -1089,13 +1092,13 @@ int test_init(struct context *ctx, char *argv[])
free_events_in_list(ctx, ctx->a.call);
if (print_headings)
printf("TEST NUA-3.0.1: PASSED\n");
printf("TEST NUA-2.0.1: PASSED\n");
if (print_headings)
printf("TEST NUA-3.0.2: init endpoint B\n");
printf("TEST NUA-2.0.2: init endpoint B\n");
ctx->b.nua = nua_create(ctx->root, b_callback, ctx,
NUTAG_PROXY(ctx->p->uri),
NUTAG_PROXY(ctx->p ? ctx->p->uri : o_proxy),
SIPTAG_FROM_STR("sip:bob@example.org"),
NUTAG_URL("sip:0.0.0.0:*"),
SOATAG_USER_SDP_STR("m=audio 5006 RTP/AVP 8 0"),
......@@ -1114,13 +1117,13 @@ int test_init(struct context *ctx, char *argv[])
free_events_in_list(ctx, ctx->b.call);
if (print_headings)
printf("TEST NUA-3.0.2: PASSED\n");
printf("TEST NUA-2.0.2: PASSED\n");
if (print_headings)
printf("TEST NUA-3.0.3: init endpoint C\n");
printf("TEST NUA-2.0.3: init endpoint C\n");
ctx->c.nua = nua_create(ctx->root, c_callback, ctx,
NUTAG_PROXY(ctx->p->uri),
NUTAG_PROXY(ctx->p ? ctx->p->uri : o_proxy),
SIPTAG_FROM_STR("sip:charlie@example.net"),
NUTAG_URL("sip:0.0.0.0:*"),
SOATAG_USER_SDP_STR("m=audio 5400 RTP/AVP 8 0"),
......@@ -1139,7 +1142,7 @@ int test_init(struct context *ctx, char *argv[])
free_events_in_list(ctx, ctx->c.call);
if (print_headings)
printf("TEST NUA-3.0.3: PASSED\n");
printf("TEST NUA-2.0.3: PASSED\n");
END();
}
......@@ -1149,6 +1152,9 @@ int test_init(struct context *ctx, char *argv[])
int test_register(struct context *ctx)
{
if (!ctx->p)
return 0; /* No proxy */
BEGIN();
struct endpoint *a = &ctx->a, *b = &ctx->b, *c = &ctx->c;
......@@ -1163,7 +1169,7 @@ int test_register(struct context *ctx)
*/
if (print_headings)
printf("TEST NUA-3.1.1: REGISTER a\n");
printf("TEST NUA-2.1: REGISTER a\n");
TEST_1(a_call->nh = nua_handle(a->nua, a_call, TAG_END()));
......@@ -1172,10 +1178,10 @@ int test_register(struct context *ctx)
run_a_until(ctx, -1, until_final_response);
if (print_headings)
printf("TEST NUA-3.1.1: PASSED\n");
printf("TEST NUA-2.1: PASSED\n");
if (print_headings)
printf("TEST NUA-3.1.1: REGISTER b\n");
printf("TEST NUA-2.2: REGISTER b\n");
TEST_1(b_call->nh = nua_handle(b->nua, b_call, TAG_END()));
......@@ -1184,10 +1190,10 @@ int test_register(struct context *ctx)
run_b_until(ctx, -1, until_final_response);
if (print_headings)
printf("TEST NUA-3.1.1: PASSED\n");
printf("TEST NUA-2.2: PASSED\n");
if (print_headings)
printf("TEST NUA-3.1.1: REGISTER c\n");
printf("TEST NUA-2.3: REGISTER c\n");
TEST_1(c_call->nh = nua_handle(c->nua, c_call, TAG_END()));
......@@ -1196,13 +1202,16 @@ int test_register(struct context *ctx)
run_c_until(ctx, -1, until_final_response);
if (print_headings)
printf("TEST NUA-3.1.1: PASSED\n");
printf("TEST NUA-2.3: PASSED\n");
END();
}
int test_unregister(struct context *ctx)
{
if (!ctx->p)
return 0; /* No proxy */
BEGIN();
struct endpoint *a = &ctx->a, *b = &ctx->b, *c = &ctx->c;
......@@ -1216,7 +1225,7 @@ int test_unregister(struct context *ctx)
*/
if (print_headings)
printf("TEST NUA-3.1.1: REGISTER a\n");
printf("TEST NUA-13.1: un-REGISTER a\n");
if (a->reg->nh) {
unregister(a, NULL, a->reg->nh, TAG_END());
......@@ -1225,10 +1234,10 @@ int test_unregister(struct context *ctx)
}
if (print_headings)
printf("TEST NUA-3.1.1: PASSED\n");
printf("TEST NUA-13.1: PASSED\n");
if (print_headings)
printf("TEST NUA-3.1.1: REGISTER b\n");
printf("TEST NUA-13.2: un-REGISTER b\n");
if (b->reg->nh) {
unregister(b, NULL, b->reg->nh, TAG_END());
......@@ -1236,10 +1245,10 @@ int test_unregister(struct context *ctx)
nua_handle_destroy(b->reg->nh), b->reg->nh = NULL;
}
if (print_headings)
printf("TEST NUA-3.1.1: PASSED\n");
printf("TEST NUA-13.2: PASSED\n");
if (print_headings)
printf("TEST NUA-3.1.1: REGISTER c\n");
printf("TEST NUA-13.3: un-REGISTER c\n");
if (c->reg->nh) {
unregister(c, NULL, c->reg->nh, TAG_END());
......@@ -1248,7 +1257,7 @@ int test_unregister(struct context *ctx)
}
if (print_headings)
printf("TEST NUA-3.1.1: PASSED\n");
printf("TEST NUA-13.3: PASSED\n");
END();
}
......@@ -1422,7 +1431,7 @@ CONDITION_FUNCTION(ack_when_completing)
Client transitions:
INIT -(C1)-> CALLING -(C2a)-> PROCEEDING -(C3+C4)-> READY
Server transitions:
INIT -(S1)-> RECEIVED -(S2a)-> EARLY -(S3a)-> COMPLETED -(S4)-> READY
INIT -(S1)-> RECEIVED -(S2a)-> EARLY -(S3b)-> COMPLETED -(S4)-> READY
B sends BYE:
READY -(T2)-> TERMINATING -(T3)-> TERMINATED
......@@ -1448,7 +1457,11 @@ int test_basic_call(struct context *ctx)
TEST_1(a_call->nh = nua_handle(a->nua, a_call, SIPTAG_TO(b->to), TAG_END()));
invite(a, a_call, a_call->nh, /* NUTAG_URL(b->contact->m_url), */
TEST_1(!nua_handle_has_active_call(a_call->nh));
TEST_1(!nua_handle_has_call_on_hold(a_call->nh));
invite(a, a_call, a_call->nh,
TAG_IF(!ctx->p, NUTAG_URL(b->contact->m_url)),
SOATAG_USER_SDP_STR(a_call->sdp),
TAG_END());
......@@ -1473,11 +1486,14 @@ int test_basic_call(struct context *ctx)
TEST_1(!e->next);
free_events_in_list(ctx, a_call);
TEST_1(nua_handle_has_active_call(a_call->nh));
TEST_1(!nua_handle_has_call_on_hold(a_call->nh));
/*
Server transitions:
INIT -(S1)-> RECEIVED: nua_i_invite, nua_i_state
RECEIVED -(S2a)-> EARLY: nua_respond(), nua_i_state
EARLY -(S3a)-> COMPLETED: nua_respond(), nua_i_state
EARLY -(S3b)-> COMPLETED: nua_respond(), nua_i_state
COMPLETED -(S4)-> READY: nua_i_ack, nua_i_state
*/
TEST_1(e = b_call->events.head); TEST_E(e->data->e_event, nua_i_invite);
......@@ -1496,6 +1512,9 @@ int test_basic_call(struct context *ctx)
TEST_1(!e->next);
free_events_in_list(ctx, b_call);
TEST_1(nua_handle_has_active_call(b_call->nh));
TEST_1(!nua_handle_has_call_on_hold(b_call->nh));
bye(b, b_call, b_call->nh, TAG_END());
run_ab_until(ctx, -1, until_terminated, -1, until_terminated);
......@@ -1509,6 +1528,8 @@ int test_basic_call(struct context *ctx)
TEST_1(!e->next);
free_events_in_list(ctx, b_call);
TEST_1(!nua_handle_has_active_call(b_call->nh));
/* A transitions:
READY -(T1)-> TERMINATED: nua_i_bye, nua_i_state
*/
......@@ -1519,6 +1540,8 @@ int test_basic_call(struct context *ctx)
TEST_1(!e->next);
free_events_in_list(ctx, a_call);
TEST_1(!nua_handle_has_active_call(a_call->nh));
nua_handle_destroy(a_call->nh), a_call->nh = NULL;
nua_handle_destroy(b_call->nh), b_call->nh = NULL;
......@@ -1586,7 +1609,8 @@ int test_reject_a(struct context *ctx)
b_call->sdp = "m=audio 5010 RTP/AVP 0 8";
TEST_1(a_call->nh = nua_handle(a->nua, a_call, SIPTAG_TO(b->to), TAG_END()));
invite(a, a_call, a_call->nh, /* NUTAG_URL(b->contact->m_url), */
invite(a, a_call, a_call->nh,
TAG_IF(!ctx->p, NUTAG_URL(b->contact->m_url)),
SIPTAG_SUBJECT_STR("reject-1"),
SOATAG_USER_SDP_STR(a_call->sdp),
TAG_END());
......@@ -1692,7 +1716,8 @@ int test_reject_b(struct context *ctx)
/* Make call reject-2 */
TEST_1(a_call->nh = nua_handle(a->nua, a_call, SIPTAG_TO(b->to), TAG_END()));
invite(a, a_call, a_call->nh, /* NUTAG_URL(b->contact->m_url), */
invite(a, a_call, a_call->nh,
TAG_IF(!ctx->p, NUTAG_URL(b->contact->m_url)),
SIPTAG_SUBJECT_STR("reject-2"),
SOATAG_USER_SDP_STR(a_call->sdp),
TAG_END());
......@@ -1828,7 +1853,8 @@ int test_reject_302(struct context *ctx)
b_call->sdp = "m=audio 5010 RTP/AVP 0 8";
TEST_1(a_call->nh = nua_handle(a->nua, a_call, SIPTAG_TO(b->to), TAG_END()));
invite(a, a_call, a_call->nh, /* NUTAG_URL(b->contact->m_url), */
invite(a, a_call, a_call->nh,
TAG_IF(!ctx->p, NUTAG_URL(b->contact->m_url)),
SIPTAG_SUBJECT_STR("reject-3"),
SOATAG_USER_SDP_STR(a_call->sdp),
TAG_END());
......@@ -2059,7 +2085,8 @@ int test_reject_401(struct context *ctx)
b_call->sdp = "m=audio 5010 RTP/AVP 0 8";
TEST_1(a_call->nh = nua_handle(a->nua, a_call, SIPTAG_TO(b->to), TAG_END()));
invite(a, a_call, a_call->nh, /* NUTAG_URL(b->contact->m_url), */
invite(a, a_call, a_call->nh,
TAG_IF(!ctx->p, NUTAG_URL(b->contact->m_url)),
SIPTAG_SUBJECT_STR("reject-401"),
SOATAG_USER_SDP_STR(a_call->sdp),
TAG_END());
......@@ -2256,7 +2283,8 @@ int test_call_cancel(struct context *ctx)
TEST_1(a_call->nh = nua_handle(a->nua, a_call, SIPTAG_TO(b->to), TAG_END()));
invite(a, a_call, a_call->nh, /* NUTAG_URL(b->contact->m_url), */
invite(a, a_call, a_call->nh,
TAG_IF(!ctx->p, NUTAG_URL(b->contact->m_url)),
SOATAG_USER_SDP_STR(a_call->sdp),
TAG_END());
......@@ -2309,7 +2337,8 @@ int test_call_cancel(struct context *ctx)
TEST_1(a_call->nh = nua_handle(a->nua, a_call, SIPTAG_TO(b->to), TAG_END()));
invite(a, a_call, a_call->nh, /* NUTAG_URL(b->contact->m_url), */
invite(a, a_call, a_call->nh,
TAG_IF(!ctx->p, NUTAG_URL(b->contact->m_url)),
SOATAG_USER_SDP_STR(a_call->sdp),
SIPTAG_REJECT_CONTACT_STR("*;audio=FALSE"),
TAG_END());
......@@ -2429,7 +2458,8 @@ int test_early_bye(struct context *ctx)
TEST_1(a_call->nh = nua_handle(a->nua, a_call, SIPTAG_TO(b->to), TAG_END()));
invite(a, a_call, a_call->nh, /* NUTAG_URL(b->contact->m_url), */
invite(a, a_call, a_call->nh,
TAG_IF(!ctx->p, NUTAG_URL(b->contact->m_url)),
SOATAG_USER_SDP_STR(a_call->sdp),
TAG_END());
......@@ -2554,7 +2584,8 @@ int test_call_hold(struct context *ctx)
"a=rtcp:6011\n";
TEST_1(a_call->nh = nua_handle(a->nua, a_call, SIPTAG_TO(b->to), TAG_END()));
invite(a, a_call, a_call->nh, /* NUTAG_URL(b->contact->m_url), */
invite(a, a_call, a_call->nh,
TAG_IF(!ctx->p, NUTAG_URL(b->contact->m_url)),
SOATAG_USER_SDP_STR(a_call->sdp),
TAG_END());
......@@ -2587,7 +2618,7 @@ int test_call_hold(struct context *ctx)
Server transitions:
INIT -(S1)-> RECEIVED: nua_i_invite, nua_i_state
RECEIVED -(S2a)-> EARLY: nua_respond(), nua_i_state
EARLY -(S3a)-> COMPLETED: nua_respond(), nua_i_state
EARLY -(S3b)-> COMPLETED: nua_respond(), nua_i_state
COMPLETED -(S4)-> READY: nua_i_ack, nua_i_state
*/
TEST_1(e = b_call->events.head); TEST_E(e->data->e_event, nua_i_invite);
......@@ -2630,7 +2661,7 @@ int test_call_hold(struct context *ctx)
/* Client transitions:
READY -(C1)-> CALLING: nua_invite(), nua_i_state
CALLING -(C3b+C4)-> READY: nua_r_invite, nua_i_state
CALLING -(C3a+C4)-> READY: nua_r_invite, nua_i_state
*/
TEST_1(e = a_call->events.head); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_calling); /* CALLING */
......@@ -2649,7 +2680,7 @@ int test_call_hold(struct context *ctx)
/*
Server transitions:
READY -(S3b)-> COMPLETED: nua_i_invite, <auto-answer>, nua_i_state
READY -(S3a)-> COMPLETED: nua_i_invite, <auto-answer>, nua_i_state
COMPLETED -(S4)-> READY: nua_i_ack, nua_i_state
*/
TEST_1(e = b_call->events.head); TEST_E(e->data->e_event, nua_i_invite);
......@@ -2692,7 +2723,7 @@ int test_call_hold(struct context *ctx)
/* Client transitions:
READY -(C1)-> CALLING: nua_invite(), nua_i_state
CALLING -(C3b+C4)-> READY: nua_r_invite, nua_i_state
CALLING -(C3a+C4)-> READY: nua_r_invite, nua_i_state
*/
TEST_1(e = b_call->events.head); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_calling); /* CALLING */
......@@ -2712,7 +2743,7 @@ int test_call_hold(struct context *ctx)
/*
Server transitions:
READY -(S3b)-> COMPLETED: nua_i_invite, <auto-answer>, nua_i_state
READY -(S3a)-> COMPLETED: nua_i_invite, <auto-answer>, nua_i_state
COMPLETED -(S4)-> READY: nua_i_ack, nua_i_state
*/
TEST_1(e = a_call->events.head); TEST_E(e->data->e_event, nua_i_invite);
......@@ -2756,7 +2787,7 @@ int test_call_hold(struct context *ctx)
/* Client transitions:
READY -(C1)-> CALLING: nua_invite(), nua_i_state
CALLING -(C3b+C4)-> READY: nua_r_invite, nua_i_state
CALLING -(C3a+C4)-> READY: nua_r_invite, nua_i_state
*/
TEST_1(e = a_call->events.head); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_calling); /* CALLING */
......@@ -2775,7 +2806,7 @@ int test_call_hold(struct context *ctx)
/*
Server transitions:
READY -(S3b)-> COMPLETED: nua_i_invite, <auto-answer>, nua_i_state
READY -(S3a)-> COMPLETED: nua_i_invite, <auto-answer>, nua_i_state
COMPLETED -(S4)-> READY: nua_i_ack, nua_i_state
*/
TEST_1(e = b_call->events.head); TEST_E(e->data->e_event, nua_i_invite);
......@@ -2819,7 +2850,7 @@ int test_call_hold(struct context *ctx)
/* Client transitions:
READY -(C1)-> CALLING: nua_invite(), nua_i_state
CALLING -(C3b+C4)-> READY: nua_r_invite, nua_i_state
CALLING -(C3a+C4)-> READY: nua_r_invite, nua_i_state
*/
TEST_1(e = b_call->events.head); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_calling); /* CALLING */
......@@ -2838,7 +2869,7 @@ int test_call_hold(struct context *ctx)
/*
Server transitions:
READY -(S3b)-> COMPLETED: nua_i_invite, <auto-answer>, nua_i_state
READY -(S3a)-> COMPLETED: nua_i_invite, <auto-answer>, nua_i_state
COMPLETED -(S4)-> READY: nua_i_ack, nua_i_state
*/
TEST_1(e = a_call->events.head); TEST_E(e->data->e_event, nua_i_invite);
......@@ -2934,7 +2965,7 @@ int test_call_hold(struct context *ctx)
/* Client transitions:
READY -(C1)-> CALLING: nua_invite(), nua_i_state
CALLING -(C3b)-> COMPLETING: nua_r_invite, nua_i_state
CALLING -(C3a)-> COMPLETING: nua_r_invite, nua_i_state
COMPLETING -(C4)-> READY: nua_ack(), nua_i_state
*/
TEST_1(e = b_call->events.head); TEST_E(e->data->e_event, nua_i_state);
......@@ -2953,7 +2984,7 @@ int test_call_hold(struct context *ctx)
/*
Server transitions:
READY -(S3b)-> COMPLETED: nua_i_invite, <auto-answer>, nua_i_state
READY -(S3a)-> COMPLETED: nua_i_invite, <auto-answer>, nua_i_state
COMPLETED -(S4)-> READY: nua_i_ack, nua_i_state