Commit 68848bbe authored by Pekka Pessi's avatar Pekka Pessi

Added nua_authorize(), event nua_i_subscription. [mm]

Added nua_notifier test cases for test_nua. With great help from Pekka.

darcs-hash:20051128173955-65a35-d42cd846576bd46844c658176574e5edbd1cdb77.gz
parent c063308b
2005-11-28 Martti Mela <martti.mela@nokia.com>
* Added nua_authorize(), enhanced nua_i_subscription. Added
nua_notifier test cases for test_nua. With great help from Pekka.
M ./libsofia-sip-ua/nea/Makefile.am
M ./libsofia-sip-ua/nea/nea.h
M ./libsofia-sip-ua/nea/nea_tag.c
M ./libsofia-sip-ua/nta/test_nta.c
M ./libsofia-sip-ua/nua/nua.c
M ./libsofia-sip-ua/nua/nua.docs
M ./libsofia-sip-ua/nua/nua.h
M ./libsofia-sip-ua/nua/nua_common.c
M ./libsofia-sip-ua/nua/nua_stack.c
M ./libsofia-sip-ua/nua/nua_stack.h
M ./libsofia-sip-ua/nua/test_nua.c
M ./libsofia-sip-ua/nua/test_proxy.c
M ./utils/Makefile.am
2005-11-28 Martti Mela <martti.mela@nokia.com>
* nua.h: added event nua_i_subscription
* nua_commmon.c: added event nua_i_subscription
* nua_stack.c: ua_event for nua_i_subscription (nea subscribers)
* nea.h, nea_tag.c, nea_tag_ref.c, nea_server.c: support for a new
tag, NEATAG_SUB(). Added nea_sub_get_request().
2005-11-15 Kai Vehmanen <kai.vehmanen@nokia.com>
* configure.ac: Added VER_LIBSOFIA_SIP_UA variables.
......
......@@ -1298,6 +1298,33 @@ void nua_authenticate(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...)
NUA_SIGNAL(nh, nua_r_authenticate, tag, value);
}
/** Authorize a subscriber.
*
* After creating a local presence server by nua_notifier(), an
* incoming subscriber launches nua_i_subscription event. Subscriber
* can be authorized in this application callback.
*
* #NUTAG_SUB tag
* #NUTAG_SUBSTATE tag
*
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
* @return
* nothing
*
* @par Related Tags:
* #NUTAG_SUB
* #NUTAG_SUBSTATE
*
* @par Events:
* (any operation events)
*/
void nua_authorize(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...)
{
NUA_SIGNAL(nh, nua_r_authorize, tag, value);
}
/*# Redirect an operation. */
void nua_redirect(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...)
{
......
......@@ -784,6 +784,73 @@ void app_i_message(int status,
} /* app_i_message */
@endcode
@subsection nua_notifier Creating Presence Server
@code
...
application_t *app;
operation_t *oper;
...
oper->app = app;
app->nua = nua_create(ssip->s_root,
app_callback,
app,
TAG_NULL());
...
oper->handle = nua_handle(app->nua, app,
NUTAG_URL(to->a_url),
SIPTAG_TO(to),
ta_tags(ta));
...
nua_notifier(oper->handle,
SIPTAG_EXPIRES_STR("3600"),
SIPTAG_EVENT_STR("presence"),
SIPTAG_CONTENT_TYPE_STR("application/pidf-partial+xml"),
NUTAG_SUBSTATE(nua_substate_pending),
TAG_END());
@endcode
After the nua_notifier object -- the presence server -- is created, an
event nua_r_notifier is launched. Status and phrase values of the
app_callback function indicate the success of the creation.
Authorization of an incoming subscription (to the local presence
server) can be handled in the callback function.
@code
void app_callback(nua_event_t event,
int status, char const *phrase,
nua_t *nua, application_t *app,
nua_handle_t *nh, oper_t *op,
sip_t const *sip, tagi_t tags[])
{
nea_sub_t *subscriber = NULL;
switch (event) {
case nua_i_subscription:
tl_gets(tags,
NEATAG_SUB_REF(subscriber),
TAG_END());
nua_authorize(nua_substate_active);
default:
break;
}
@endcode
@subsection nua_shutting_down Shutdown
The following functions show an example of how application terminates
......@@ -1603,6 +1670,7 @@ For reference:
* #nua_i_publish \n
* #nua_i_refer \n
* #nua_i_subscribe \n
* #nua_i_subscription \n
* #nua_i_state \n
* #nua_i_terminated \n
* #nua_i_update
......
......@@ -90,6 +90,7 @@ typedef enum nua_event_e {
nua_i_message, /**< Incoming MESSAGE */
nua_i_chat, /**< Incoming chat MESSAGE */
nua_i_subscribe, /**< Incoming subscription */
nua_i_subscription, /**< Incoming subscription to be authorized */
nua_i_notify, /**< Incoming event */
nua_i_method, /**< Incoming, unknown method */
......@@ -104,6 +105,7 @@ typedef enum nua_event_e {
nua_r_shutdown, /**< Answer to nua_shutdown() */
nua_r_notifier, /**< Answer to nua_notifier() */
nua_r_terminate, /**< Answer to nua_terminate() */
nua_r_authorize, /**< Answer to nua_authorize() */
/* SIP responses */
nua_r_register, /**< Answer to outgoing REGISTER */
......@@ -124,7 +126,7 @@ typedef enum nua_event_e {
nua_r_notify, /**< Answer to outgoing NOTIFY */
nua_r_method, /**< Answer to unknown outgoing method */
/* Internal events */
/* Internal events: nua hides them from application */
nua_r_authenticate,
nua_r_redirect,
nua_r_destroy,
......@@ -317,6 +319,9 @@ void nua_cancel(nua_handle_t *, tag_type_t, tag_value_t, ...);
/** Authenticate an operation. */
void nua_authenticate(nua_handle_t *, tag_type_t, tag_value_t, ...);
/** Authorize a subscriber. */
void nua_authorize(nua_handle_t *, tag_type_t, tag_value_t, ...);
/** Redirect an operation. */
void nua_redirect(nua_handle_t *, tag_type_t, tag_value_t, ...);
......
......@@ -192,6 +192,7 @@ char const *nua_event_name(nua_event_t event)
case nua_i_message: return "nua_i_message";
case nua_i_chat: return "nua_i_chat";
case nua_i_subscribe: return "nua_i_subscribe";
case nua_i_subscription: return "nua_i_subscription";
case nua_i_notify: return "nua_i_notify";
case nua_i_method: return "nua_i_method";
......@@ -224,6 +225,7 @@ char const *nua_event_name(nua_event_t event)
case nua_r_cancel: return "nua_r_cancel";
case nua_r_authenticate: return "nua_r_authenticate";
case nua_r_authorize: return "nua_r_authorize";
case nua_r_redirect: return "nua_r_redirect";
case nua_r_destroy: return "nua_r_destroy";
case nua_r_respond: return "nua_r_respond";
......
......@@ -279,6 +279,8 @@ int ua_init(su_root_t *root, nua_t *nua)
DNHP_SET(dnhp, service_route_enable, 1);
DNHP_SET(dnhp, path_enable, 1);
DNHP_SET(dnhp, substate, nua_substate_active);
DNHP_SET(dnhp, allow, sip_allow_make(dnh->nh_home, nua_allow_str));
DNHP_SET(dnhp, supported, sip_supported_make(dnh->nh_home, "timer, 100rel"));
DNHP_SET(dnhp, user_agent,
......@@ -521,6 +523,7 @@ static int
static void
ua_authenticate(nua_t *, nua_handle_t *, nua_event_t, tagi_t const *),
ua_authorize(nua_t *, nua_handle_t *, nua_event_t, tagi_t const *),
ua_notifier(nua_t *, nua_handle_t *, nua_event_t, tagi_t const *),
ua_terminate(nua_t *, nua_handle_t *, nua_event_t, tagi_t const *),
ua_respond(nua_t *, nua_handle_t *, int , char const *, tagi_t const *),
......@@ -710,6 +713,9 @@ void ua_signal(nua_t *nua, su_msg_r msg, event_t *e)
case nua_r_authenticate:
ua_authenticate(nua, nh, e->e_event, tags);
break;
case nua_r_authorize:
ua_authorize(nua, nh, e->e_event, tags);
break;
case nua_r_ack:
ua_ack(nua, nh, tags);
break;
......@@ -920,6 +926,8 @@ int ua_set_params(nua_t *nua, nua_handle_t *nh, nua_event_t e,
int service_route_enable = NHP_GET(ohp, dnhp, service_route_enable);
int path_enable = NHP_GET(ohp, dnhp, path_enable);
int substate = NHP_GET(ohp, dnhp, substate);
sip_allow_t const *allow = NONE;
char const *allow_str = NONE;
char const *allowing = NULL;
......@@ -980,6 +988,7 @@ int ua_set_params(nua_t *nua, nua_handle_t *nh, nua_event_t e,
NUTAG_MEDIA_FEATURES_REF(media_features),
NUTAG_SERVICE_ROUTE_ENABLE_REF(service_route_enable),
NUTAG_PATH_ENABLE_REF(path_enable),
NUTAG_SUBSTATE_REF(substate),
SIPTAG_SUPPORTED_REF(supported),
SIPTAG_SUPPORTED_STR_REF(supported_str),
......@@ -1069,6 +1078,8 @@ int ua_set_params(nua_t *nua, nua_handle_t *nh, nua_event_t e,
NHP_SET(nhp, service_route_enable, service_route_enable != 0);
NHP_SET(nhp, path_enable, path_enable != 0);
NHP_SET(nhp, substate, substate);
/* Set string in handle pref structure */
#define NHP_SET_STR(nhp, name, str) \
if (str != NONE && str0cmp(str, nhp->nhp_##name)) { \
......@@ -1311,6 +1322,7 @@ ua_get_params(nua_t *nua, nua_handle_t *nh, nua_event_t e, tagi_t const *tags)
TIF(NUTAG_MEDIA_FEATURES, media_features),
TIF(NUTAG_SERVICE_ROUTE_ENABLE, service_route_enable),
TIF(NUTAG_PATH_ENABLE, path_enable),
TIF(NUTAG_SUBSTATE, substate),
TIF(SIPTAG_SUPPORTED, supported),
TIF_STR(SIPTAG_SUPPORTED_STR, supported),
......@@ -6384,6 +6396,32 @@ ua_authenticate(nua_t *nua, nua_handle_t *nh, nua_event_t e,
}
/* ======================================================================== */
/* Authorization */
void
ua_authorize(nua_t *nua, nua_handle_t *nh, nua_event_t e,
tagi_t const *tags)
{
nea_sub_t *sub = NULL;
nea_state_t state = nea_extended;
tl_gets(tags,
NEATAG_SUB_REF(sub),
NUTAG_SUBSTATE_REF(state),
TAG_END());
if (sub && state > 0) {
nea_sub_auth(sub, state, TAG_NEXT(tags));
ua_event(nua, nh, NULL, e, SIP_200_OK, TAG_END());
}
else {
ua_event(nua, nh, NULL, e, SIP_500_INTERNAL_SERVER_ERROR, TAG_END());
}
return;
}
/* ======================================================================== */
/* Event server */
......@@ -6419,7 +6457,6 @@ ua_notifier(nua_t *nua, nua_handle_t *nh, nua_event_t e, tagi_t const *tags)
NUTAG_URL_REF(url),
SIPTAG_EVENT_REF(event),
SIPTAG_EVENT_STR_REF(event_s),
SIPTAG_CONTENT_TYPE_REF(ct),
SIPTAG_CONTENT_TYPE_STR_REF(ct_s),
SIPTAG_PAYLOAD_REF(pl),
SIPTAG_PAYLOAD_STR_REF(pl_s),
......@@ -6446,12 +6483,7 @@ ua_notifier(nua_t *nua, nua_handle_t *nh, nua_event_t e, tagi_t const *tags)
else if (!(ev = nh_notifier_event(nh, home, event, tags)))
status = 500, phrase = "Could not create an event view";
else if (nea_server_update(nh->nh_notifier, ev,
SIPTAG_CONTENT_TYPE(ct),
SIPTAG_CONTENT_TYPE_STR(ct_s),
SIPTAG_PAYLOAD(pl),
SIPTAG_PAYLOAD_STR(pl_s),
TAG_END()) < 0)
else if (nea_server_update(nh->nh_notifier, ev, TAG_NEXT(tags)) < 0)
status = 500, phrase = "No content for event";
else if (nea_server_notify(nh->nh_notifier, ev) < 0)
......@@ -6528,15 +6560,29 @@ void authenticate_watcher(nea_server_t *nes,
msg_t *msg = NULL;
nta_incoming_t *irq = NULL;
irq = nea_subnode_get_incoming(sn);
msg = nta_incoming_getrequest(irq);
nua_handle_t *dnh = nh;
nua_handle_preferences_t *ohp = nh->nh_prefs;
nua_handle_preferences_t const *dnhp = dnh->nh_prefs;
/* OK. In nhp (nua_handle_preferences_t) structure we have the
current default action (or state) for incoming
subscriptions. This can now be modified in the application
callback. */
int substate = NHP_GET(ohp, dnhp, substate);
irq = nea_sub_get_request(sn->sn_subscriber);
msg = nta_incoming_getrequest(irq);
ua_event(nua, nh, msg, nua_i_subscription, SIP_200_OK,
NEATAG_SUB(sn),
TAG_END());
NEATAG_SUB(sn->sn_subscriber),
TAG_END());
if (sn->sn_state == nea_embryonic) {
SU_DEBUG_7(("nea: authenticate_watcher: new watcher\n"));
nea_server_auth(sn->sn_subscriber, nea_active, TAG_END());
nea_sub_auth(sn->sn_subscriber, substate,
TAG_IF(substate != nua_substate_active,
NEATAG_FAKE(1)),
TAG_END());
}
else if (sn->sn_state == nea_terminated || sn->sn_expires == 0) {
nea_server_flush(nes, NULL);
......
......@@ -326,6 +326,9 @@ typedef struct nua_handle_preferences
unsigned:0;
/* Subscriber state, i.e. nua_substate_pending */
unsigned nhp_substate;
sip_allow_t *nhp_allow;
sip_supported_t *nhp_supported;
sip_user_agent_t *nhp_user_agent;
......@@ -355,6 +358,7 @@ typedef struct nua_handle_preferences
unsigned nhp_media_features:1;
unsigned nhp_service_route_enable:1;
unsigned nhp_path_enable:1;
unsigned nhp_substate:1;
unsigned nhp_allow:1;
unsigned nhp_supported:1;
unsigned nhp_user_agent:1;
......
......@@ -48,6 +48,9 @@
#ifndef NTA_TAG_H
#include <nta_tag.h>
#endif
#ifndef NEA_TAG_H
#include <nea_tag.h>
#endif
#ifndef SOA_TAG_H
#include <soa_tag.h>
#endif
......@@ -1106,10 +1109,11 @@ extern tag_typedef_t nutag_substate;
extern tag_typedef_t nutag_substate_ref;
enum nua_substate {
nua_substate_embryonic = 0,
nua_substate_pending,
nua_substate_active,
nua_substate_terminated
nua_substate_extended = nea_extended,
nua_substate_embryonic = nea_embryonic,
nua_substate_pending = nea_pending,
nua_substate_active = nea_active,
nua_substate_terminated = nea_terminated
};
/** Add media tags from our offer to Accept-Contact headers.
......
......@@ -450,6 +450,7 @@ OPERATION(unsubscribe);
OPERATION(notify);
OPERATION(notifier);
OPERATION(terminate);
OPERATION(authorize);
int do_register(struct endpoint *ep,
struct call *call, nua_handle_t *nh,
......@@ -676,7 +677,7 @@ int test_params(struct context *ctx)
ctx->a.nua = nua_create(ctx->root, a_callback, ctx,
SIPTAG_FROM_STR("sip:alice@example.com"),
NUTAG_URL("sip:*:*;transport=udp"),
NUTAG_URL("sip:0.0.0.0:*;transport=udp"),
TAG_END());
TEST_1(ctx->a.nua);
......@@ -730,6 +731,7 @@ int test_params(struct context *ctx)
NUTAG_MEDIA_FEATURES(1),
NUTAG_SERVICE_ROUTE_ENABLE(0),
NUTAG_PATH_ENABLE(0),
NUTAG_SUBSTATE(nua_substate_pending),
SIPTAG_SUPPORTED(sip_supported_make(tmphome, "humppaa,kuole")),
SIPTAG_ALLOW(sip_allow_make(tmphome, "OPTIONS, INFO")),
......@@ -777,6 +779,7 @@ int test_params(struct context *ctx)
int media_features = -1;
int service_route_enable = -1;
int path_enable = -1;
int substate = -1;
sip_allow_t const *allow = NONE;
char const *allow_str = "NONE";
......@@ -825,6 +828,7 @@ int test_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_SUBSTATE_REF(substate),
SIPTAG_SUPPORTED_REF(supported),
SIPTAG_SUPPORTED_STR_REF(supported_str),
......@@ -839,7 +843,7 @@ int test_params(struct context *ctx)
NUTAG_REGISTRAR_REF(registrar),
TAG_END());
TEST(n, 29);
TEST(n, 30);
TEST_S(sip_header_as_string(tmphome, (void *)from), Alice);
TEST_S(from_str, Alice);
......@@ -867,6 +871,7 @@ int test_params(struct context *ctx)
TEST(media_features, 1);
TEST(service_route_enable, 0);
TEST(path_enable, 0);
TEST(substate, nua_substate_pending);
TEST_S(sip_header_as_string(tmphome, (void *)allow), "OPTIONS, INFO");
TEST_S(allow_str, "OPTIONS, INFO");
......@@ -884,6 +889,8 @@ int test_params(struct context *ctx)
free_events_in_list(ctx, ctx->a.call);
}
/* Test that only those tags that have been set per handle are returned by nua_get_hparams() */
{
sip_from_t const *from = NONE;
char const *from_str = "NONE";
......@@ -911,6 +918,7 @@ int test_params(struct context *ctx)
int media_features = -1;
int service_route_enable = -1;
int path_enable = -1;
int substate = -1;
sip_allow_t const *allow = NONE;
char const *allow_str = "NONE";
......@@ -959,6 +967,7 @@ int test_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_SUBSTATE_REF(substate),
SIPTAG_SUPPORTED_REF(supported),
SIPTAG_SUPPORTED_STR_REF(supported_str),
......@@ -1003,6 +1012,7 @@ int test_params(struct context *ctx)
TEST(media_features, -1);
TEST(service_route_enable, -1);
TEST(path_enable, -1);
TEST(substate, -1);
TEST(allow, NONE);
TEST_S(allow_str, "NONE");
......@@ -1062,7 +1072,7 @@ int test_init(struct context *ctx, char *argv[])
ctx->a.nua = nua_create(ctx->root, a_callback, ctx,
NUTAG_PROXY(ctx->p->uri),
SIPTAG_FROM_STR("sip:alice@example.com"),
NUTAG_URL("sip:*:*"),
NUTAG_URL("sip:0.0.0.0:*"),
SOATAG_USER_SDP_STR("m=audio 5004 RTP/AVP 0 8"),
TAG_END());
TEST_1(ctx->a.nua);
......@@ -1088,7 +1098,7 @@ int test_init(struct context *ctx, char *argv[])
ctx->b.nua = nua_create(ctx->root, b_callback, ctx,
NUTAG_PROXY(ctx->p->uri),
SIPTAG_FROM_STR("sip:bob@example.org"),
NUTAG_URL("sip:*:*"),
NUTAG_URL("sip:0.0.0.0:*"),
SOATAG_USER_SDP_STR("m=audio 5006 RTP/AVP 8 0"),
TAG_END());
TEST_1(ctx->b.nua);
......@@ -1113,7 +1123,7 @@ int test_init(struct context *ctx, char *argv[])
ctx->c.nua = nua_create(ctx->root, c_callback, ctx,
NUTAG_PROXY(ctx->p->uri),
SIPTAG_FROM_STR("sip:charlie@example.net"),
NUTAG_URL("sip:*:*"),
NUTAG_URL("sip:0.0.0.0:*"),
SOATAG_USER_SDP_STR("m=audio 5400 RTP/AVP 8 0"),
TAG_END());
TEST_1(ctx->c.nua);
......@@ -3816,6 +3826,14 @@ CONDITION_FUNCTION(save_until_notified_and_responded)
return ep->flags.b.bit0 && ep->flags.b.bit1;
}
CONDITION_FUNCTION(save_until_subscription)
{
save_event_in_list(ctx, event, ep, call);
return event == nua_i_subscription;
}
int test_events(struct context *ctx)
{
BEGIN();
......@@ -3826,6 +3844,7 @@ int test_events(struct context *ctx)
sip_t const *sip;
tagi_t const *n_tags, *r_tags;
url_t b_url[1];
nea_sub_t *sub;
char const open[] =
"<?xml version='1.0' encoding='UTF-8'?>\n"
......@@ -4083,10 +4102,21 @@ int test_events(struct context *ctx)
printf("TEST NUA-12.4: establishing 2nd subscription\n");
notifier(b, b_call, b_call->nh,
SIPTAG_EVENT_STR("presence"),
SIPTAG_CONTENT_TYPE_STR("application/xpidf+xml"),
SIPTAG_PAYLOAD_STR(open),
NEATAG_THROTTLE(1),
NUTAG_SUBSTATE(nua_substate_pending),
TAG_END());
run_b_until(ctx, nua_r_notifier, until_final_response);
notifier(b, b_call, b_call->nh,
SIPTAG_EVENT_STR("presence"),
SIPTAG_CONTENT_TYPE_STR("application/xpidf+xml"),
SIPTAG_PAYLOAD_STR(open),
NEATAG_THROTTLE(1),
NEATAG_FAKE(1),
NUTAG_SUBSTATE(nua_substate_pending),
TAG_END());
run_b_until(ctx, nua_r_notifier, until_final_response);
......@@ -4096,7 +4126,7 @@ int test_events(struct context *ctx)
TAG_END());
run_ab_until(ctx, -1, save_until_notified_and_responded,
-1, NULL /* XXX save_until_received */);
-1, save_until_subscription);
/* Client events:
nua_subscribe(), nua_i_notify/nua_r_subscribe
......@@ -4109,7 +4139,7 @@ int test_events(struct context *ctx)
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_r_subscribe);
TEST_1(tl_find(e->data->e_tags, nutag_substate));
TEST(tl_find(e->data->e_tags, nutag_substate)->t_value,
nua_substate_active);
nua_substate_pending);
}
else {
TEST_E(e->data->e_event, nua_r_subscribe);
......@@ -4126,14 +4156,62 @@ int test_events(struct context *ctx)
TEST_1(sip->sip_content_type);
TEST_S(sip->sip_content_type->c_type, "application/xpidf+xml");
TEST_1(sip->sip_subscription_state);
TEST_S(sip->sip_subscription_state->ss_substate, "pending");
TEST_1(sip->sip_subscription_state->ss_expires);
TEST_1(tl_find(n_tags, nutag_substate));
TEST(tl_find(n_tags, nutag_substate)->t_value,
nua_substate_pending);
TEST_1(!e->next);
free_events_in_list(ctx, a_call);
/*
Server events:
nua_i_subscription
*/
TEST_1(e = b_call->events.head);
TEST_E(e->data->e_event, nua_i_subscription);
TEST(tl_gets(e->data->e_tags, NEATAG_SUB_REF(sub), TAG_END()), 1);
TEST_1(sub);
TEST_1(!e->next);
free_events_in_list(ctx, b_call);
/* Authorize user A */
authorize(b, b_call, b_call->nh,
NUTAG_SUBSTATE(nua_substate_active),
NEATAG_SUB(sub),
NEATAG_FAKE(0),
TAG_END());
run_ab_until(ctx, -1, save_until_notified,
-1, save_until_final_response);
/* subscriber events:
nua_i_notify
*/
TEST_1(e = a_call->events.head); TEST_E(e->data->e_event, nua_i_notify);
TEST_1(sip = sip_object(e->data->e_msg));
TEST_1(sip->sip_event); TEST_S(sip->sip_event->o_type, "presence");
TEST_1(sip->sip_content_type);
TEST_S(sip->sip_content_type->c_type, "application/xpidf+xml");
TEST_1(sip->sip_subscription_state);
TEST_S(sip->sip_subscription_state->ss_substate, "active");
TEST_1(sip->sip_subscription_state->ss_expires);
n_tags = e->data->e_tags;
TEST_1(tl_find(n_tags, nutag_substate));
TEST(tl_find(n_tags, nutag_substate)->t_value,
nua_substate_active);
TEST_1(!e->next);
free_events_in_list(ctx, a_call);
/*
Server events:
nua_r_authorize
*/
TEST_1(e = b_call->events.head);
TEST_E(e->data->e_event, nua_r_authorize);
TEST_1(!e->next);
if (print_headings)
printf("TEST NUA-12.4: PASSED\n");
......
......@@ -129,7 +129,7 @@ test_proxy_init(su_root_t *root, struct proxy *proxy)
proxy->root = root;
proxy->agent = nta_agent_create(root,
URL_STRING_MAKE("sip:*:*"),
URL_STRING_MAKE("sip:0.0.0.0:*"),
NULL, NULL,
NTATAG_UA(0),
TAG_END());
......
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