Commit 154fb9a0 authored by Pekka Pessi's avatar Pekka Pessi

nua_subnotref.c, nua_notifier.c, sofia-sip/nua_tag.h, nua_tag.c, nua_params.c,...

nua_subnotref.c, nua_notifier.c, sofia-sip/nua_tag.h, nua_tag.c, nua_params.c, nua_params.h: first refer event may or may not have id parameter. Added parameter nutag_refer_with_id for changing the behaviour (in case something breaks down if id *is* included with first subscription).

test_params.c: added tests for setting and getting NUTAG_REFER_WITH_ID().

test_refer.c: testing Event: refer with and without id.

darcs-hash:20060830133749-65a35-92739849ca90f77da65687f3002b710277a233d3.gz
parent 1db605fb
......@@ -226,8 +226,10 @@ nua_dialog_usage_at(nua_dialog_state_t const *ds,
continue;
if (strcmp(event->o_type, o->o_type))
continue;
if (str0casecmp(event->o_id, o->o_id))
continue;
if (str0casecmp(event->o_id, o->o_id)) {
if (event->o_id || strcmp(event->o_type, "refer"))
continue;
}
}
return (nua_dialog_usage_t **)prev;
......
......@@ -60,6 +60,9 @@ struct nua_dialog_state
unsigned ds_has_session:1; /**< We have session */
unsigned ds_has_register:1; /**< We have registration */
unsigned ds_has_publish:1; /**< We have publish */
unsigned ds_has_referrals:1; /**< We have (or have had) referrals */
unsigned :0;
unsigned ds_has_events; /**< We have events */
......
......@@ -128,9 +128,7 @@ int nua_stack_process_subsribe(nua_t *nua,
if (nh == NULL || du == NULL) {
/* Hard-coded support only for refer subscriptions */
if (o && str0cmp(o->o_type, "refer") == 0)
nta_incoming_treply(irq,
SET_STATUS(481, "Subscription Does Not Exist"),
TAG_END());
nta_incoming_treply(irq, SET_STATUS1(SIP_403_FORBIDDEN), TAG_END());
else
nta_incoming_treply(irq,
SET_STATUS1(SIP_489_BAD_EVENT),
......@@ -227,15 +225,15 @@ int nua_stack_notify(nua_t *nua,
sip_time_t now;
if (cr->cr_orq) {
return UA_EVENT2(e, 500, "Request already in progress");
return UA_EVENT2(e, 900, "Request already in progress");
}
nua_stack_init_handle(nua, nh, nh_has_nothing, NULL, TAG_NEXT(tags));
msg = nua_creq_msg(nua, nh, cr, cr->cr_retry_count,
SIP_METHOD_NOTIFY,
NUTAG_ADD_CONTACT(1),
TAG_NEXT(tags));
SIP_METHOD_NOTIFY,
NUTAG_ADD_CONTACT(1),
TAG_NEXT(tags));
sip = sip_object(msg);
if (!sip)
......@@ -355,6 +353,7 @@ static int process_response_to_notify(nua_handle_t *nh,
/* ======================================================================== */
/* REFER */
/* RFC 3515 */
/** @internal Process incoming REFER. */
int nua_stack_process_refer(nua_t *nua,
nua_handle_t *nh,
......@@ -375,7 +374,11 @@ int nua_stack_process_refer(nua_t *nua,
created = 1;
}
event = sip_event_format(nh->nh_home, "refer;id=%u", sip->sip_cseq->cs_seq);
if (nh->nh_ds->ds_has_referrals || NH_PGET(nh, refer_with_id))
event = sip_event_format(nh->nh_home, "refer;id=%u", sip->sip_cseq->cs_seq);
else
event = sip_event_make(nh->nh_home, "refer");
if (event)
du = nua_dialog_usage_add(nh, nh->nh_ds, nua_notify_usage, event);
......@@ -391,7 +394,8 @@ int nua_stack_process_refer(nua_t *nua,
nu = nua_dialog_usage_private(du);
du->du_ready = 1;
nh->nh_ds->ds_has_referrals = 1;
nua_dialog_uas_route(nh, nh->nh_ds, sip, 1); /* Set route and tags */
if (!sip->sip_referred_by) {
......
......@@ -97,6 +97,7 @@ int nua_stack_set_defaults(nua_handle_t *nh,
NHP_SET(nhp, path_enable, 1);
NHP_SET(nhp, refer_expires, 300);
NHP_SET(nhp, refer_with_id, 1);
NHP_SET(nhp, substate, nua_substate_active);
......@@ -222,7 +223,10 @@ int nua_stack_init_instance(nua_handle_t *nh, tagi_t const *tags)
* NUTAG_OUTBOUND() \n
* NUTAG_DETECT_NETWORK_UPDATES() \n
* NUTAG_PATH_ENABLE() \n
* NUTAG_REFER_EXPIRES() \n
* NUTAG_REFER_WITH_ID() \n
* NUTAG_REGISTRAR() \n
* NUTAG_RETRY_COUNT() \n
* NUTAG_SERVICE_ROUTE_ENABLE() \n
* NUTAG_SESSIONRESHER() \n
* NUTAG_SESSION_TIMER() \n
......@@ -246,7 +250,6 @@ int nua_stack_init_instance(nua_handle_t *nh, tagi_t const *tags)
* SIPTAG_SUPPORTED_STR() \n
* SIPTAG_USER_AGENT() \n
* SIPTAG_USER_AGENT_STR() \n
* NUTAG_RETRY_COUNT() \n
*
* nua_set_params() also accepts any soa tags, defined in
* <sofia-sip/soa_tag.h>, and nta tags, defined in <sofia-sip/nta_tag.h>.
......@@ -281,6 +284,8 @@ int nua_stack_init_instance(nua_handle_t *nh, tagi_t const *tags)
* NUTAG_MEDIA_FEATURES() \n
* NUTAG_MIN_SE() \n
* NUTAG_PATH_ENABLE() \n
* NUTAG_REFER_EXPIRES() \n
* NUTAG_REFER_WITH_ID() \n
* NUTAG_RETRY_COUNT() \n
* NUTAG_SERVICE_ROUTE_ENABLE() \n
* NUTAG_SESSIONRESHER() \n
......@@ -422,6 +427,14 @@ int nua_stack_set_params(nua_t *nua, nua_handle_t *nh, nua_event_t e,
else if (t->t_tag == nutag_path_enable) {
NHP_SET(nhp, path_enable, t->t_value != 0);
}
/* NUTAG_REFER_EXPIRES(refer_expires) */
else if (t->t_tag == nutag_refer_expires) {
NHP_SET(nhp, refer_expires, t->t_value);
}
/* NUTAG_REFER_WITH_ID(refer_with_id) */
else if (t->t_tag == nutag_refer_with_id) {
NHP_SET(nhp, refer_with_id, t->t_value != 0);
}
/* NUTAG_SUBSTATE(substate) */
else if (t->t_tag == nutag_substate) {
NHP_SET(nhp, substate, (int)t->t_value);
......@@ -862,6 +875,8 @@ int nua_stack_get_params(nua_t *nua, nua_handle_t *nh, nua_event_t e,
TIF(NUTAG_MEDIA_FEATURES, media_features),
TIF(NUTAG_SERVICE_ROUTE_ENABLE, service_route_enable),
TIF(NUTAG_PATH_ENABLE, path_enable),
TIF(NUTAG_REFER_EXPIRES, refer_expires),
TIF(NUTAG_REFER_WITH_ID, refer_with_id),
TIF(NUTAG_SUBSTATE, substate),
......
......@@ -81,6 +81,8 @@ typedef struct nua_handle_preferences
unsigned nhp_service_route_enable:1;
/** Enable Path */
unsigned nhp_path_enable:1;
/** Always include id with Event: refer */
unsigned nhp_refer_with_id:1;
unsigned:0;
......@@ -129,6 +131,7 @@ typedef struct nua_handle_preferences
unsigned nhb_media_features:1;
unsigned nhb_service_route_enable:1;
unsigned nhb_path_enable:1;
unsigned nhb_refer_with_id:1;
unsigned nhb_refer_expires:1;
unsigned nhb_substate:1;
unsigned nhb_allow:1;
......
......@@ -60,7 +60,8 @@ struct event_usage
enum nua_substate eu_substate; /**< Subscription state */
sip_time_t eu_expires; /**< Proposed expiration time */
unsigned eu_notified; /**< Number of NOTIFYs received */
unsigned eu_final_wait; /**< Waiting for final NOTIFY */
unsigned eu_final_wait:1; /**< Waiting for final NOTIFY */
unsigned eu_no_id:1; /**< Do not use "id" (even if we have one) */
};
static char const *nua_subscribe_usage_name(nua_dialog_usage_t const *du);
......@@ -132,7 +133,7 @@ nua_stack_subscribe(nua_t *nua, nua_handle_t *nh, nua_event_t e,
return UA_EVENT3(e, 500, "Invalid handle for SUBSCRIBE",
NUTAG_SUBSTATE(nua_substate_terminated));
else if (cr->cr_orq)
return UA_EVENT2(e, 500, "Request already in progress");
return UA_EVENT2(e, 900, "Request already in progress");
/* Initialize allow and auth */
nua_stack_init_handle(nua, nh, nh_has_subscribe, "NOTIFY", TAG_NEXT(tags));
......@@ -151,30 +152,36 @@ nua_stack_subscribe(nua_t *nua, nua_handle_t *nh, nua_event_t e,
if (sip) {
sip_event_t *o = sip->sip_event;
if (e != nua_r_subscribe) { /* Unsubscribe */
du = nua_dialog_usage_get(nh->nh_ds, nua_subscribe_usage, o);
if (du == NULL && o == NULL) {
du = nua_dialog_usage_get(nh->nh_ds, nua_subscribe_usage, NONE);
if (du && du->du_event)
sip_add_dup(msg, sip, (sip_header_t *)du->du_event);
}
du = nua_dialog_usage_get(nh->nh_ds, nua_subscribe_usage, o);
if (du == NULL && o == NULL)
du = nua_dialog_usage_get(nh->nh_ds, nua_subscribe_usage, NONE);
eu = nua_dialog_usage_private(du);
if (du && du->du_event && (o == NULL || (o->o_id && eu->eu_no_id))) {
if (eu->eu_no_id) /* No id (XXX - nor other parameters) */
sip_add_make(msg, sip, sip_event_class, du->du_event->o_type);
else
sip_add_dup(msg, sip, (sip_header_t *)du->du_event);
}
if (du) {
/* Embryonic subscription is just a placeholder */
eu = nua_dialog_usage_private(du);
if (eu->eu_substate == nua_substate_terminated ||
eu->eu_substate == nua_substate_embryonic) {
nua_dialog_usage_remove(nh, nh->nh_ds, du);
msg_destroy(msg);
return UA_EVENT3(e, SIP_200_OK,
NUTAG_SUBSTATE(nua_substate_terminated),
TAG_END());
}
if (e == nua_r_subscribe) {
if (du == NULL) /* Create dialog usage */
/* We allow here SUBSCRIBE without event */
du = nua_dialog_usage_add(nh, nh->nh_ds, nua_subscribe_usage, o);
}
else if (du) { /* Unsubscribe */
/* Embryonic subscription is just a placeholder */
if (eu->eu_substate == nua_substate_terminated ||
eu->eu_substate == nua_substate_embryonic) {
nua_dialog_usage_remove(nh, nh->nh_ds, du);
msg_destroy(msg);
return UA_EVENT3(e, SIP_200_OK,
NUTAG_SUBSTATE(nua_substate_terminated),
TAG_END());
}
}
else
/* We allow here SUBSCRIBE without event */
du = nua_dialog_usage_add(nh, nh->nh_ds, nua_subscribe_usage, o);
}
/* Store message template with supported features (eventlist) */
......@@ -516,7 +523,9 @@ int nua_stack_process_notify(nua_t *nua,
eu = nua_dialog_usage_private(du); assert(eu);
eu->eu_notified++;
if (!sip->sip_event->o_id) {
eu->eu_no_id = 1;
}
if (subs == NULL) {
/* Do some compatibility stuff here */
......@@ -647,10 +656,10 @@ nua_stack_refer(nua_t *nua, nua_handle_t *nh, nua_event_t e, tagi_t const *tags)
sip_event_t *event = NULL;
if (nh_is_special(nh) && !nua_handle_has_subscribe(nh)) {
return UA_EVENT2(e, 500, "Invalid handle for REFER");
return UA_EVENT2(e, 900, "Invalid handle for REFER");
}
else if (cr->cr_orq) {
return UA_EVENT2(e, 500, "Request already in progress");
return UA_EVENT2(e, 900, "Request already in progress");
}
nua_stack_init_handle(nua, nh, nh_has_subscribe, "NOTIFY", TAG_NEXT(tags));
......
......@@ -71,6 +71,7 @@ tag_typedef_t nutag_min_se = UINTTAG_TYPEDEF(min_se);
tag_typedef_t nutag_session_refresher = INTTAG_TYPEDEF(session_refresher);
tag_typedef_t nutag_update_refresh = BOOLTAG_TYPEDEF(update_refresh);
tag_typedef_t nutag_refer_expires = UINTTAG_TYPEDEF(refer_expires);
tag_typedef_t nutag_refer_with_id = BOOLTAG_TYPEDEF(refer_with_id);
tag_typedef_t nutag_autoalert = BOOLTAG_TYPEDEF(autoAlert);
tag_typedef_t nutag_autoanswer = BOOLTAG_TYPEDEF(autoAnswer);
tag_typedef_t nutag_autoack = BOOLTAG_TYPEDEF(autoACK);
......
......@@ -1390,6 +1390,36 @@ SOFIAPUBVAR tag_typedef_t nutag_refer_expires;
#define NUTAG_REFER_EXPIRES_REF(x) nutag_refer_expires_ref, tag_uint_vr((&(x)))
SOFIAPUBVAR tag_typedef_t nutag_refer_expires_ref;
/**Always use id parameter with refer event.
*
* When REFER creates an implicit subscription, the event header identifying
* the subscription may have an id parameter. The id parameter can be either
* always included (default behavior), or the parameter can be used only for
* the second and subsequent REFER requests received in a given dialog.
*
* Note that once the subscription is created, the event header should not
* be modified. Therefore this tag has no effect on already established
* subscriptions, and its use makes sense largely on nua_set_params() only.
*
* @par Used with
* nua_set_params() (nua_set_hparams(), nua_invite(), nua_respond(),
* nua_update()).
*
* @par Parameter type
* int (boolean)
*
* @par Values
* 0 (false, do not use id with subscription created with first REFER request) \n
* 1 (true, use id with all subscriptions created with REFER request) \n
*
* Corresponding tag taking reference parameter is NUTAG_REFER_WITH_ID_REF()
*/
#define NUTAG_REFER_WITH_ID(x) nutag_refer_with_id, tag_bool_v(x)
SOFIAPUBVAR tag_typedef_t nutag_refer_with_id;
#define NUTAG_REFER_WITH_ID_REF(x) nutag_refer_with_id_ref, tag_bool_vr(&(x))
SOFIAPUBVAR tag_typedef_t nutag_refer_with_id_ref;
/** Add media tags from our offer to Accept-Contact headers.
*
* Automatically generate Accept-Contact headers for caller
......
......@@ -160,6 +160,8 @@ int test_nua_params(struct context *ctx)
NUTAG_MEDIA_FEATURES(1),
NUTAG_SERVICE_ROUTE_ENABLE(0),
NUTAG_PATH_ENABLE(0),
NUTAG_REFER_EXPIRES(333),
NUTAG_REFER_WITH_ID(0),
NUTAG_SUBSTATE(nua_substate_pending),
NUTAG_KEEPALIVE(66),
......@@ -214,6 +216,8 @@ int test_nua_params(struct context *ctx)
int media_features = -1;
int service_route_enable = -1;
int path_enable = -1;
unsigned refer_expires = -1;
int refer_with_id = -1;
int substate = -1;
sip_allow_t const *allow = NONE;
......@@ -268,6 +272,8 @@ int test_nua_params(struct context *ctx)
NUTAG_MEDIA_FEATURES_REF(media_features),
NUTAG_SERVICE_ROUTE_ENABLE_REF(service_route_enable),
NUTAG_PATH_ENABLE_REF(path_enable),
NUTAG_REFER_EXPIRES_REF(refer_expires),
NUTAG_REFER_WITH_ID_REF(refer_with_id),
NUTAG_SUBSTATE_REF(substate),
SIPTAG_SUPPORTED_REF(supported),
......@@ -289,7 +295,7 @@ int test_nua_params(struct context *ctx)
NUTAG_REGISTRAR_REF(registrar),
TAG_END());
TEST(n, 34);
TEST(n, 36);
TEST_S(sip_header_as_string(tmphome, (void *)from), Alice);
TEST_S(from_str, Alice);
......@@ -317,6 +323,8 @@ int test_nua_params(struct context *ctx)
TEST(media_features, 1);
TEST(service_route_enable, 0);
TEST(path_enable, 0);
TEST(refer_expires, 333);
TEST(refer_with_id, 0);
TEST(substate, nua_substate_pending);
TEST_S(sip_header_as_string(tmphome, (void *)allow), "OPTIONS, INFO");
......@@ -370,6 +378,8 @@ int test_nua_params(struct context *ctx)
int media_features = -1;
int service_route_enable = -1;
int path_enable = -1;
unsigned refer_expires = -1;
int refer_with_id = -1;
int substate = -1;
sip_allow_t const *allow = NONE;
......@@ -464,6 +474,8 @@ int test_nua_params(struct context *ctx)
TEST(media_features, -1);
TEST(service_route_enable, -1);
TEST(path_enable, -1);
TEST(refer_expires, -1);
TEST(refer_with_id, -1);
TEST(substate, -1);
TEST(allow, NONE);
......
......@@ -48,6 +48,14 @@ int accept_call_immediately(CONDITION_PARAMS);
/* ======================================================================== */
/* NUA-9 tests: REFER */
int test_refer0(struct context *ctx, int refer_with_id, char const *tests);
int test_refer(struct context *ctx)
{
/* test twice, once without id and once with id */
return test_refer0(ctx, 0, "NUA-9.1") || test_refer0(ctx, 1, "NUA-9.2");
}
/* Referred call:
A B
......@@ -91,8 +99,7 @@ int accept_call_immediately(CONDITION_PARAMS);
*/
int test_refer(struct context *ctx)
int test_refer0(struct context *ctx, int refer_with_id, char const *tests)
{
BEGIN();
......@@ -101,7 +108,7 @@ int test_refer(struct context *ctx)
struct call *a_c2;
struct event *e;
sip_t const *sip;
sip_event_t const *r_event;
sip_event_t const *a_event, *b_event;
sip_refer_to_t const *refer_to;
sip_referred_by_t const *referred_by;
......@@ -113,7 +120,14 @@ int test_refer(struct context *ctx)
su_home_auto(tmphome, sizeof(tmphome));
if (print_headings)
printf("TEST NUA-9.1.1: REFER: make a call between A and B\n");
printf("TEST %s: REFER: refer A to C\n", tests);
if (print_headings)
printf("TEST %s.1: REFER: make a call between A and B\n", tests);
/* Do (not) include id with first implicit Event: refer */
nua_set_params(ctx->a.nua, NUTAG_REFER_WITH_ID(refer_with_id), TAG_END());
run_a_until(ctx, nua_r_set_params, until_final_response);
TEST_1(a_c2 = calloc(1, (sizeof *a_c2) + (sizeof *a_c2->events)));
call_init(a_c2);
......@@ -177,7 +191,7 @@ int test_refer(struct context *ctx)
free_events_in_list(ctx, b->events);
if (print_headings)
printf("TEST NUA-9.1.1: PASSED\n");
printf("TEST %s.1: PASSED\n", tests);
/* ---------------------------------------------------------------------- */
/*
......@@ -189,7 +203,7 @@ int test_refer(struct context *ctx)
*/
if (print_headings)
printf("TEST NUA-9.1.2: refer A to C\n");
printf("TEST %s.2: refer A to C\n", tests);
/* XXX: check header parameters! */
*sip_refer_to_init(r0)->r_url = *c->contact->m_url;
......@@ -205,6 +219,11 @@ int test_refer(struct context *ctx)
*/
TEST_1(e = a->events->head); TEST_E(e->data->e_event, nua_i_refer);
TEST(e->data->e_status, 202);
a_event = NULL;
TEST(tl_gets(e->data->e_tags,
NUTAG_REFER_EVENT_REF(a_event),
TAG_END()), 1);
TEST_1(a_event); TEST_1(a_event = sip_event_dup(tmphome, a_event));
TEST_1(sip = sip_object(e->data->e_msg));
TEST_1(sip->sip_refer_to);
TEST_1(refer_to = sip_refer_to_dup(tmphome, sip->sip_refer_to));
......@@ -221,21 +240,22 @@ int test_refer(struct context *ctx)
TEST_1(e = b->events->head); TEST_E(e->data->e_event, nua_r_refer);
TEST(e->data->e_status, 100);
TEST(tl_gets(e->data->e_tags,
NUTAG_REFER_EVENT_REF(r_event),
NUTAG_REFER_EVENT_REF(b_event),
TAG_END()), 1);
TEST_1(r_event); TEST_1(r_event->o_id);
TEST_1(r_event = sip_event_dup(tmphome, r_event));
TEST_1(b_event); TEST_1(b_event->o_id);
TEST_1(b_event = sip_event_dup(tmphome, b_event));
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_refer);
TEST(e->data->e_status, 202);
TEST_1(sip = sip_object(e->data->e_msg));
TEST(strtoul(r_event->o_id, NULL, 10), sip->sip_cseq->cs_seq);
TEST(strtoul(b_event->o_id, NULL, 10), sip->sip_cseq->cs_seq);
if (!e->next)
run_b_until(ctx, -1, save_until_received);
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_notify);
TEST(e->data->e_status, 200);
TEST_1(sip = sip_object(e->data->e_msg));
TEST_1(sip->sip_event);
TEST_S(sip->sip_event->o_id, r_event->o_id);
if (refer_with_id)
TEST_S(sip->sip_event->o_id, b_event->o_id);
TEST_1(sip->sip_subscription_state);
TEST_S(sip->sip_subscription_state->ss_substate, "pending");
TEST_1(sip->sip_payload && sip->sip_payload->pl_data);
......@@ -244,7 +264,7 @@ int test_refer(struct context *ctx)
free_events_in_list(ctx, b->events);
if (print_headings)
printf("TEST NUA-9.1.2: PASSED\n");
printf("TEST %s.2: PASSED\n", tests);
/* ---------------------------------------------------------------------- */
/*
......@@ -256,10 +276,10 @@ int test_refer(struct context *ctx)
*/
if (print_headings)
printf("TEST NUA-9.1.3: extend expiration time for implied subscription\n");
printf("TEST %s.3: extend expiration time for implied subscription\n", tests);
SUBSCRIBE(b, b_call, b_call->nh,
SIPTAG_EVENT(r_event),
SIPTAG_EVENT(b_event),
SIPTAG_EXPIRES_STR("3600"),
TAG_END());
run_ab_until(ctx, -1, save_until_final_response,
......@@ -289,14 +309,15 @@ int test_refer(struct context *ctx)
TEST(e->data->e_status, 200);
TEST_1(sip = sip_object(e->data->e_msg));
TEST_1(sip->sip_event);
TEST_S(sip->sip_event->o_id, r_event->o_id);
if (refer_with_id)
TEST_S(sip->sip_event->o_id, b_event->o_id);
TEST_1(sip->sip_subscription_state);
TEST_S(sip->sip_subscription_state->ss_substate, "pending");
TEST_1(!e->next);
free_events_in_list(ctx, b->events);
if (print_headings)
printf("TEST NUA-9.1.3: PASSED\n");
printf("TEST %s.3: PASSED\n", tests);
/* ---------------------------------------------------------------------- */
/*
......@@ -319,7 +340,7 @@ int test_refer(struct context *ctx)
*/
if (print_headings)
printf("TEST NUA-9.1.3: A invites C\n");
printf("TEST %s.4: A invites C\n", tests);
*sip_to_init(to)->a_url = *refer_to->r_url;
to->a_display = refer_to->r_display;
......@@ -329,7 +350,7 @@ int test_refer(struct context *ctx)
TEST_1(a_c2->nh = nua_handle(a->nua, a_c2, SIPTAG_TO(to), TAG_END()));
INVITE(a, a_c2, a_c2->nh, /* NUTAG_URL(refer_to->r_url), */
NUTAG_REFER_EVENT(r_event),
NUTAG_REFER_EVENT(a_event),
NUTAG_NOTIFY_REFER(a_call->nh),
SOATAG_USER_SDP_STR(a_c2->sdp),
SIPTAG_REFERRED_BY(referred_by),
......@@ -387,7 +408,8 @@ int test_refer(struct context *ctx)
TEST_1(sip->sip_payload && sip->sip_payload->pl_data);
TEST_S(sip->sip_payload->pl_data, "SIP/2.0 200 OK\r\n");
TEST_1(sip->sip_event);
TEST_S(sip->sip_event->o_id, r_event->o_id);
if (refer_with_id)
TEST_S(sip->sip_event->o_id, b_event->o_id);
TEST_1(!e->next);
free_events_in_list(ctx, b->events);
......@@ -412,7 +434,7 @@ int test_refer(struct context *ctx)
free_events_in_list(ctx, c->events);
if (print_headings)
printf("TEST NUA-9.1.3: PASSED\n");
printf("TEST %s.4: PASSED\n", tests);
/* ---------------------------------------------------------------------- */
/*
......@@ -422,7 +444,7 @@ int test_refer(struct context *ctx)
*/
if (print_headings)
printf("TEST NUA-9.1.4: terminate call between A and B\n");
printf("TEST %s.5.1: terminate call between A and B\n", tests);
BYE(a, a_call, a_call->nh, TAG_END());
run_ab_until(ctx, -1, until_terminated, -1, until_terminated);
......@@ -449,7 +471,7 @@ int test_refer(struct context *ctx)
free_events_in_list(ctx, b->events);
if (print_headings)
printf("TEST NUA-9.1.4: PASSED\n");
printf("TEST %s.5.1: PASSED\n", tests);
nua_handle_destroy(a_call->nh), a_call->nh = NULL;
nua_handle_destroy(b_call->nh), b_call->nh = NULL;
......@@ -463,7 +485,7 @@ int test_refer(struct context *ctx)
*/
if (print_headings)
printf("TEST NUA-9.1.5: terminate call between A and C\n");
printf("TEST %s.5.2: terminate call between A and C\n", tests);
BYE(a, a_c2, a_c2->nh, TAG_END());
run_abc_until(ctx, -1, until_terminated, -1, NULL, -1, until_terminated);
......@@ -490,7 +512,7 @@ int test_refer(struct context *ctx)
free_events_in_list(ctx, c->events);
if (print_headings)
printf("TEST NUA-9.1.5: PASSED\n");
printf("TEST %s.5.2: PASSED\n", tests);
nua_handle_destroy(a_c2->nh), a_c2->nh = NULL;
a->call->next = NULL; free(a_c2);
......@@ -498,7 +520,7 @@ int test_refer(struct context *ctx)
nua_handle_destroy(c_call->nh), c_call->nh = NULL;
if (print_headings)
printf("TEST NUA-9: PASSED\n");
printf("TEST %s: PASSED\n", tests);
su_home_deinit(tmphome);
......@@ -538,4 +560,3 @@ int accept_call_immediately(CONDITION_PARAMS)
return 0;
}
}
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