Commit a0ca0fa5 authored by Pekka Pessi's avatar Pekka Pessi

Moved preference/parameter setting/getting into its own nua_params.c module.

darcs-hash:20060329162733-65a35-1b42ea060567e6129cb27aeff7fc94ed4824c43e.gz
parent 35ad0798
......@@ -41,6 +41,7 @@ nobase_include_sofia_HEADERS = \
libnua_la_SOURCES = nua.c nua_stack.h nua_common.c nua_stack.c \
nua_dialog.c nua_dialog.h \
nua_params.c nua_params.h \
nua_register.c nua_session.c nua_options.c \
nua_message.c nua_publish.c nua_subnotref.c \
nua_event_server.c \
......
......@@ -515,58 +515,6 @@ sip_to_t const *nua_handle_local(nua_handle_t const *nh)
return nh ? nh->nh_ds->ds_local : NULL;
}
/** Set NUA parameters.
*
* @param nua Pointer to NUA stack object
* @param tag, value, ... List of tagged parameters
*
* @return
* nothing
*
* @par Related tags:
* #NUTAG_AUTOACK \n
* #NUTAG_AUTOALERT \n
* #NUTAG_AUTOANSWER \n
* #NUTAG_EARLY_MEDIA \n
* #NUTAG_ENABLEINVITE \n
* #NUTAG_ENABLEMESSAGE \n
* #NUTAG_ENABLEMESSENGER \n
* #NUTAG_INVITE_TIMER \n
* #NUTAG_MEDIA_FEATURES \n
* #NUTAG_MIN_SE \n
* #NUTAG_PROXY \n
* #NUTAG_REGISTRAR \n
* #NUTAG_SESSION_REFRESHER \n
* #NUTAG_SESSION_TIMER \n
* #NUTAG_URL \n
* #NUTAG_USER_AGENT \n
* #NUTAG_UPDATE_REFRESH \n
* #NUTAG_SUBSTATE \n
* #NUTAG_SMIME_ENABLE \n
* #NUTAG_SMIME_OPT \n
* #NUTAG_SMIME_PROTECTION_MODE \n
* #NUTAG_SMIME_MESSAGE_DIGEST \n
* #NUTAG_SMIME_SIGNATURE \n
* #NUTAG_SMIME_KEY_ENCRYPTION \n
* #NUTAG_SMIME_MESSAGE_ENCRYPTION \n
* #NUTAG_SIPS_URL \n
* #SIPTAG_FROM_STR \n
* #SIPTAG_ORGANIZATION_STR \n
* #SIPTAG_SUPPORTED_STR \n
* #SIPTAG_ALLOW_STR \n
* #NTATAG_DEFAULT_PROXY \n
* #NTATAG_SIP_T1 \n
* #NTATAG_SIP_T2 \n
* #NTATAG_SIP_T4 \n
* #NTATAG_SIP_T1X64 \n
* #NTATAG_DEBUG_DROP_PROB \n
* #NTATAG_SIPFLAGS
*
* nua_set_params() also accepts any soa tags, defined in <soa_tag.h>.
*
* @par Events:
* none
*/
void nua_set_params(nua_t *nua, tag_type_t tag, tag_value_t value, ...)
{
ta_list ta;
......@@ -579,23 +527,6 @@ void nua_set_params(nua_t *nua, tag_type_t tag, tag_value_t value, ...)
ta_end(ta);
}
/** Get NUA parameters.
*
* Get values of NUA parameters in nua_r_get_params event.
*
* @param nua Pointer to NUA stack object
* @param tag, value, ... List of tagged parameters
*
* @return
* nothing
*
* @par Related tags:
* #TAG_ANY \n
* othervise same tags as nua_set_params()
*
* @par Events:
* #nua_r_get_params
*/
void nua_get_params(nua_t *nua, tag_type_t tag, tag_value_t value, ...)
{
ta_list ta;
......@@ -620,82 +551,11 @@ void nua_get_params(nua_t *nua, tag_type_t tag, tag_value_t value, ...)
SU_DEBUG_1(("nua: " #event " with invalid handle %p\n", nh)); \
}
/** Set handle-specific parameters.
*
* @param nh Pointer to a NUA handle
* @param tag, value, ... List of tagged parameters
*
* @return
* nothing
*
* @par Related tags:
* #NUTAG_AUTOACK \n
* #NUTAG_AUTOALERT \n
* #NUTAG_AUTOANSWER \n
* #NUTAG_EARLY_MEDIA \n
* #NUTAG_ENABLEINVITE \n
* #NUTAG_ENABLEMESSAGE \n
* #NUTAG_ENABLEMESSENGER \n
* #NUTAG_INVITE_TIMER \n
* #NUTAG_MEDIA_FEATURES \n
* #NUTAG_MIN_SE \n
* #NUTAG_PROXY (XXX) \n
* #NUTAG_REGISTRAR \n
* #NUTAG_SESSION_REFRESHER \n
* #NUTAG_SESSION_TIMER \n
* #NUTAG_USER_AGENT \n
* #NUTAG_UPDATE_REFRESH \n
* #NUTAG_SMIME_ENABLE \n
* #NUTAG_SMIME_OPT \n
* #NUTAG_SMIME_PROTECTION_MODE \n
* #NUTAG_SMIME_MESSAGE_DIGEST \n
* #NUTAG_SMIME_SIGNATURE \n
* #NUTAG_SMIME_KEY_ENCRYPTION \n
* #NUTAG_SMIME_MESSAGE_ENCRYPTION \n
* #NUTAG_SIPS_URL \n
* #SIPTAG_ORGANIZATION \n
* #SIPTAG_ORGANIZATION_STR \n
* #SIPTAG_SUPPORTED \n
* #SIPTAG_SUPPORTED_STR \n
* #SIPTAG_ALLOW_STR \n
*
* @par Events:
* none
*/
void nua_set_hparams(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...)
{
NUA_SIGNAL(nh, nua_r_set_params, tag, value);
}
/** Get values of handle-specific parameters in nua_r_get_params event.
*
* Application will specify either expilicit list of tags it is interested
* in, or a filter (at the moment, TAG_ANY()). The values are returned as a
* list of tags in the nua_r_get_params event.
*
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
* The handle-specific parameters will contain only the parameters actually
* modified by application, either by nua_set_handle_params() or some other
* handle-specific call. Currently, no NTA parameters are returned. They are
* returned only when application asks for user-agent-level parameters using
* either nua_get_params() or using default handle, eg.
* @code
* nua_get_handle_params(nua_default(nua), TAG_ANY())
* @endcode
*
*
* @return
* nothing
*
* @par Related tags:
* #TAG_ANY \n
* othervise same tags as nua_set_handle_params()
*
* @par Events:
* #nua_r_get_params
*/
void nua_get_hparams(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...)
{
NUA_SIGNAL(nh, nua_r_get_params, tag, value);
......
This diff is collapsed.
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2006 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef NUA_PARAMS_H /** Defined when <nua_params.h> has been included. */
#define NUA_PARAMS_H
/**@internal @file nua_params.h
* @brief Parameters and their handling
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
* @author Kai Vehmanen <Kai.Vehmanen@nokia.com>
*
* @date Created: Wed Mar 8 11:38:18 EET 2006 ppessi
*/
typedef struct nua_handle_preferences
{
unsigned nhp_retry_count; /**< times to retry a request */
unsigned nhp_max_subscriptions;
/* Session-related preferences */
unsigned nhp_invite_enable:1;
unsigned nhp_auto_alert:1;
unsigned nhp_early_media:1;/**< Establish early media session */
unsigned nhp_auto_answer:1;
unsigned nhp_auto_ack:1; /**< Automatically ACK a final response */
unsigned :0;
/** INVITE timeout.
*
* If no response is received in nhp_invite_timeout seconds,
* INVITE client transaction times out
*/
unsigned nhp_invite_timeout;
/* REGISTER Keepalive intervals */
unsigned nhp_keepalive, nhp_keepalive_stream;
/** Default session timer (in seconds, 0 disables) */
unsigned nhp_session_timer;
/** Default Min-SE Delta value */
unsigned nhp_min_se;
/** no (preference), local or remote */
enum nua_session_refresher nhp_refresher;
unsigned nhp_update_refresh:1; /**< Use UPDATE to refresh */
/* Messaging preferences */
unsigned nhp_message_enable : 1;
/** Be bug-compatible with Windows Messenger */
unsigned nhp_win_messenger_enable : 1;
/** PIM-IW hack */
unsigned nhp_message_auto_respond : 1;
/* Preferences for registration (and dialog establishment) */
unsigned nhp_callee_caps:1; /**< Add callee caps to contact */
unsigned nhp_media_features:1;/**< Add media features to caps*/
/** Enable Service-Route */
unsigned nhp_service_route_enable:1;
/** Enable Path */
unsigned nhp_path_enable:1;
unsigned:0;
/* Default lifetime for implicit subscriptions created by REFER */
unsigned nhp_refer_expires;
/* 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;
char const *nhp_ua_name;
sip_organization_t *nhp_organization;
char const *nhp_instance;
/**< Outbound OPTIONS */
char const *nhp_outbound;
/* A bit for each feature set by application */
union {
uint32_t set_any;
struct {
unsigned nhb_retry_count:1;
unsigned nhb_max_subscriptions:1;
unsigned nhb_invite_enable:1;
unsigned nhb_auto_alert:1;
unsigned nhb_early_media:1;
unsigned nhb_auto_answer:1;
unsigned nhb_auto_ack:1;
unsigned nhb_invite_timeout:1;
unsigned nhb_keepalive:1;
unsigned nhb_keepalive_stream:1;
unsigned nhb_session_timer:1;
unsigned nhb_min_se:1;
unsigned nhb_refresher:1;
unsigned nhb_update_refresh:1;
unsigned nhb_message_enable:1;
unsigned nhb_win_messenger_enable:1;
unsigned nhb_message_auto_respond:1;
unsigned nhb_callee_caps:1;
unsigned nhb_media_features:1;
unsigned nhb_service_route_enable:1;
unsigned nhb_path_enable:1;
unsigned nhb_refer_expires:1;
unsigned nhb_substate:1;
unsigned nhb_allow:1;
unsigned nhb_supported:1;
unsigned nhb_user_agent:1;
unsigned nhb_ua_name:1;
unsigned nhb_organization:1;
unsigned nhb_instance:1;
unsigned nhb_outbound:1;
unsigned :0;
} set_bits;
} nhp_set;
} nua_handle_preferences_t;
#define DNHP_GET(dnhp, pref) ((dnhp)->nhp_##pref)
#define NHP_GET(nhp, dnhp, pref) \
((nhp)->nhp_set.set_bits.nhb_##pref \
? (nhp)->nhp_##pref : (dnhp)->nhp_##pref)
#define NHP_SET(nhp, pref, value) \
((nhp)->nhp_##pref = (value), \
(nhp)->nhp_set.set_bits.nhb_##pref = 1)
/* Check if preference is set */
#define NHP_ISSET(nhp, pref) \
((nhp)->nhp_set.set_bits.nhb_##pref)
#define NHP_UNSET_ALL(nhp) ((nhp)->nhp_set.set_any = 0)
#define NHP_SET_ALL(nhp) ((nhp)->nhp_set.set_any = 0xffffffffU)
#define NHP_IS_ANY_SET(nhp) ((nhp)->nhp_set.set_any != 0)
/* Get preference from handle, if set, otherwise from default handle */
#define NH_PGET(nh, pref) \
NHP_GET((nh)->nh_prefs, (nh)->nh_nua->nua_dhandle->nh_prefs, pref)
/* Get preference from default handle */
#define DNH_PGET(dnh, pref) \
DNHP_GET((dnh)->nh_prefs, pref)
/* Check if preference is set in the handle */
#define NH_PISSET(nh, pref) \
(NHP_ISSET((nh)->nh_prefs, pref) && \
(nh)->nh_nua->nua_dhandle->nh_prefs != (nh)->nh_prefs)
#endif /* NUA_PARAMS_H */
This diff is collapsed.
......@@ -75,6 +75,10 @@ SOFIA_BEGIN_DECLS
#include <sigcomp.h>
#endif
#ifndef NUA_PARAMS_H
#include <nua_params.h>
#endif
typedef struct event_s event_t;
#define NONE ((void *)-1)
......@@ -187,131 +191,6 @@ typedef struct nua_session_state
TAG_IF((include) && (soa) && soa_is_remote_chat_active(soa) >= 0, \
SOATAG_ACTIVE_CHAT(soa_is_remote_chat_active(soa)))
typedef struct nua_handle_preferences
{
unsigned nhp_retry_count; /**< times to retry a request */
unsigned nhp_max_subscriptions;
/* Session-related preferences */
unsigned nhp_invite_enable:1;
unsigned nhp_auto_alert:1;
unsigned nhp_early_media:1;/**< Establish early media session */
unsigned nhp_auto_answer:1;
unsigned nhp_auto_ack:1; /**< Automatically ACK a final response */
unsigned :0;
/** INVITE timeout.
*
* If no response is received in nhp_invite_timeout seconds,
* INVITE client transaction times out
*/
unsigned nhp_invite_timeout;
/** Default session timer (in seconds, 0 disables) */
unsigned nhp_session_timer;
/** Default Min-SE Delta value */
unsigned nhp_min_se;
/** no (preference), local or remote */
enum nua_session_refresher nhp_refresher;
unsigned nhp_update_refresh:1; /**< Use UPDATE to refresh */
/* Messaging preferences */
unsigned nhp_message_enable : 1;
/** Be bug-compatible with Windows Messenger */
unsigned nhp_win_messenger_enable : 1;
/** PIM-IW hack */
unsigned nhp_message_auto_respond : 1;
/* Preferences for registration (and dialog establishment) */
unsigned nhp_callee_caps:1; /**< Add callee caps to contact */
unsigned nhp_media_features:1;/**< Add media features to caps*/
/** Enable Service-Route */
unsigned nhp_service_route_enable:1;
/** Enable Path */
unsigned nhp_path_enable:1;
unsigned:0;
/* Default lifetime for implicit subscriptions created by REFER */
unsigned nhp_refer_expires;
/* 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;
char const *nhp_ua_name;
sip_organization_t *nhp_organization;
char const *nhp_instance;
/**< Outbound OPTIONS */
char const *nhp_outbound;
/* A bit for each feature set by application */
union {
uint32_t set_any;
struct {
unsigned nhp_retry_count:1;
unsigned nhp_max_subscriptions:1;
unsigned nhp_invite_enable:1;
unsigned nhp_auto_alert:1;
unsigned nhp_early_media:1;
unsigned nhp_auto_answer:1;
unsigned nhp_auto_ack:1;
unsigned nhp_invite_timeout:1;
unsigned nhp_session_timer:1;
unsigned nhp_min_se:1;
unsigned nhp_refresher:1;
unsigned nhp_update_refresh:1;
unsigned nhp_message_enable:1;
unsigned nhp_win_messenger_enable:1;
unsigned nhp_message_auto_respond:1;
unsigned nhp_callee_caps:1;
unsigned nhp_media_features:1;
unsigned nhp_service_route_enable:1;
unsigned nhp_path_enable:1;
unsigned nhp_refer_expires:1;
unsigned nhp_substate:1;
unsigned nhp_allow:1;
unsigned nhp_supported:1;
unsigned nhp_user_agent:1;
unsigned nhp_ua_name:1;
unsigned nhp_organization:1;
unsigned nhp_instance;
unsigned nhp_outbound;
unsigned :0;
} set_bits;
} nhp_set;
} nua_handle_preferences_t;
/* Get preference from default handle */
#define DNH_PGET(dnh, pref) \
DNHP_GET((dnh)->nh_prefs, pref)
#define DNHP_GET(dnhp, pref) ((dnhp)->nhp_##pref)
#define DNHP_SET(dnhp, pref, value) \
((dnhp)->nhp_##pref = (value), (dnhp)->nhp_set.set_bits.nhp_##pref = 1)
/* Get preference from handle, if set, otherwise from default handle */
#define NH_PGET(nh, pref) \
NHP_GET((nh)->nh_prefs, (nh)->nh_nua->nua_dhandle->nh_prefs, pref)
#define NHP_GET(nhp, dnhp, pref) \
((nhp)->nhp_set.set_bits.nhp_##pref \
? (nhp)->nhp_##pref : (dnhp)->nhp_##pref)
/* Check if preference is set in the handle */
#define NH_PISSET(nh, pref) \
(NHP_ISSET((nh)->nh_prefs, pref) && \
(nh)->nh_nua->nua_dhandle->nh_prefs != (nh)->nh_prefs)
/* Check if preference is set */
#define NHP_ISSET(nhp, pref) \
((nhp)->nhp_set.set_bits.nhp_##pref)
#define NHP_UNSET_ALL(nhp) ((nhp)->nhp_set.set_any = 0)
#define NHP_SET_ALL(nhp) ((nhp)->nhp_set.set_any = 0xffffffffU)
#define NHP_IS_ANY_SET(nhp) ((nhp)->nhp_set.set_any != 0)
/** NUA handle.
*
*/
......@@ -534,6 +413,12 @@ void nh_destroy(nua_t *nua, nua_handle_t *nh);
nua_handle_t *nh_validate(nua_t *nua, nua_handle_t *maybe);
int nua_stack_set_defaults(nua_handle_t *nh, nua_handle_preferences_t *nhp);
void nua_stack_set_from(nua_t *, int initial, tagi_t const *tags);
int nua_stack_init_instance(nua_handle_t *nh, tagi_t const *tags);
int nua_stack_init_handle(nua_t *nua, nua_handle_t *nh,
enum nh_kind kind,
char const *default_allow,
......
......@@ -69,12 +69,12 @@ 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_autoAlert = BOOLTAG_TYPEDEF(autoAlert);
tag_typedef_t nutag_autoAnswer = BOOLTAG_TYPEDEF(autoAnswer);
tag_typedef_t nutag_autoACK = BOOLTAG_TYPEDEF(autoACK);
tag_typedef_t nutag_enableInvite = BOOLTAG_TYPEDEF(enableInvite);
tag_typedef_t nutag_enableMessage = BOOLTAG_TYPEDEF(enableMessage);
tag_typedef_t nutag_enableMessenger = BOOLTAG_TYPEDEF(enableMessenger);
tag_typedef_t nutag_autoalert = BOOLTAG_TYPEDEF(autoAlert);
tag_typedef_t nutag_autoanswer = BOOLTAG_TYPEDEF(autoAnswer);
tag_typedef_t nutag_autoack = BOOLTAG_TYPEDEF(autoACK);
tag_typedef_t nutag_enableinvite = BOOLTAG_TYPEDEF(enableInvite);
tag_typedef_t nutag_enablemessage = BOOLTAG_TYPEDEF(enableMessage);
tag_typedef_t nutag_enablemessenger = BOOLTAG_TYPEDEF(enableMessenger);
/* Start NRC Boston */
......@@ -106,6 +106,9 @@ tag_typedef_t nutag_outbound_set2 = STRTAG_TYPEDEF(outbound_set2);
tag_typedef_t nutag_outbound_set3 = STRTAG_TYPEDEF(outbound_set3);
tag_typedef_t nutag_outbound_set4 = STRTAG_TYPEDEF(outbound_set4);
tag_typedef_t nutag_keepalive = UINTTAG_TYPEDEF(keepalive);
tag_typedef_t nutag_keepalive_stream = UINTTAG_TYPEDEF(keepalive_stream);
tag_typedef_t nutag_sip_parser = PTRTAG_TYPEDEF(sip_parser);
tag_typedef_t nutag_use_dialog = BOOLTAG_TYPEDEF(use_dialog);
......
......@@ -392,11 +392,11 @@ extern tag_typedef_t nutag_update_refresh_ref;
*
* Corresponding tag taking reference parameter is NUTAG_AUTOALERT_REF()
*/
#define NUTAG_AUTOALERT(x) nutag_autoAlert, tag_bool_v(x)
extern tag_typedef_t nutag_autoAlert;
#define NUTAG_AUTOALERT(x) nutag_autoalert, tag_bool_v(x)
extern tag_typedef_t nutag_autoalert;
#define NUTAG_AUTOALERT_REF(x) nutag_autoAlert_ref, tag_bool_vr(&(x))
extern tag_typedef_t nutag_autoAlert_ref;
#define NUTAG_AUTOALERT_REF(x) nutag_autoalert_ref, tag_bool_vr(&(x))
extern tag_typedef_t nutag_autoalert_ref;
/** ACK automatically
*
......@@ -413,11 +413,11 @@ extern tag_typedef_t nutag_autoAlert_ref;
*
* Corresponding tag taking reference parameter is NUTAG_AUTOACK_REF()
*/
#define NUTAG_AUTOACK(x) nutag_autoACK, tag_bool_v(x)
extern tag_typedef_t nutag_autoACK;
#define NUTAG_AUTOACK(x) nutag_autoack, tag_bool_v(x)
extern tag_typedef_t nutag_autoack;
#define NUTAG_AUTOACK_REF(x) nutag_autoACK_ref, tag_bool_vr(&(x))
extern tag_typedef_t nutag_autoACK_ref;
#define NUTAG_AUTOACK_REF(x) nutag_autoack_ref, tag_bool_vr(&(x))
extern tag_typedef_t nutag_autoack_ref;
/** Answer (200 Ok) automatically to incoming call
*
......@@ -434,11 +434,11 @@ extern tag_typedef_t nutag_autoACK_ref;
*
* Corresponding tag taking reference parameter is NUTAG_AUTOANSWER_REF()
*/
#define NUTAG_AUTOANSWER(x) nutag_autoAnswer, tag_bool_v(x)
extern tag_typedef_t nutag_autoAnswer;
#define NUTAG_AUTOANSWER(x) nutag_autoanswer, tag_bool_v(x)
extern tag_typedef_t nutag_autoanswer;
#define NUTAG_AUTOANSWER_REF(x) nutag_autoAnswer_ref, tag_bool_vr(&(x))
extern tag_typedef_t nutag_autoAnswer_ref;
#define NUTAG_AUTOANSWER_REF(x) nutag_autoanswer_ref, tag_bool_vr(&(x))
extern tag_typedef_t nutag_autoanswer_ref;
/** Enable incoming INVITE
*
......@@ -455,11 +455,11 @@ extern tag_typedef_t nutag_autoAnswer_ref;
*
* Corresponding tag taking reference parameter is NUTAG_ENABLEINVITE_REF()
*/
#define NUTAG_ENABLEINVITE(x) nutag_enableInvite, tag_bool_v(x)
extern tag_typedef_t nutag_enableInvite;
#define NUTAG_ENABLEINVITE(x) nutag_enableinvite, tag_bool_v(x)
extern tag_typedef_t nutag_enableinvite;
#define NUTAG_ENABLEINVITE_REF(x) nutag_enableInvite_ref, tag_bool_vr(&(x))
extern tag_typedef_t nutag_enableInvite_ref;
#define NUTAG_ENABLEINVITE_REF(x) nutag_enableinvite_ref, tag_bool_vr(&(x))
extern tag_typedef_t nutag_enableinvite_ref;
/** Enable incoming MESSAGE
*
......@@ -476,11 +476,11 @@ extern tag_typedef_t nutag_enableInvite_ref;
*
* Corresponding tag taking reference parameter is NUTAG_ENABLEMESSAGE_REF()
*/
#define NUTAG_ENABLEMESSAGE(x) nutag_enableMessage, tag_bool_v(x)
extern tag_typedef_t nutag_enableMessage;
#define NUTAG_ENABLEMESSAGE(x) nutag_enablemessage, tag_bool_v(x)
extern tag_typedef_t nutag_enablemessage;
#define NUTAG_ENABLEMESSAGE_REF(x) nutag_enableMessage_ref, tag_bool_vr(&(x))
extern tag_typedef_t nutag_enableMessage_ref;
#define NUTAG_ENABLEMESSAGE_REF(x) nutag_enablemessage_ref, tag_bool_vr(&(x))
extern tag_typedef_t nutag_enablemessage_ref;
/** Enable incoming MESSAGE with To tag.
*
......@@ -499,12 +499,12 @@ extern tag_typedef_t nutag_enableMessage_ref;
*
* Corresponding tag taking reference parameter is NUTAG_ENABLEMESSENGER_REF()
*/
#define NUTAG_ENABLEMESSENGER(x) nutag_enableMessenger, tag_bool_v(x)
extern tag_typedef_t nutag_enableMessenger;
#define NUTAG_ENABLEMESSENGER(x) nutag_enablemessenger, tag_bool_v(x)
extern tag_typedef_t nutag_enablemessenger;
#define NUTAG_ENABLEMESSENGER_REF(x) \
nutag_enableMessenger_ref, tag_bool_vr(&(x))
extern tag_typedef_t nutag_enableMessenger_ref;
nutag_enablemessenger_ref, tag_bool_vr(&(x))
extern tag_typedef_t nutag_enablemessenger_ref;
/* Start NRC Boston */
......@@ -922,6 +922,56 @@ extern tag_typedef_t nutag_auth;
#define NUTAG_AUTH_REF(x) nutag_auth_ref, tag_str_vr(&(x))
extern tag_typedef_t nutag_auth_ref;
/** Keepalive interval in seconds.
*
* @par Used with
* nua_register() \n
* nua_set_params() \n
* nua_get_params()
* nua_set_hparams() \n
* nua_get_hparams()
*
* @par Parameter type
* unsigned int
*
* @par Values
* - 0 - disable keepalives
* - 90 - default value (90 seconds)
*
* Corresponding tag taking reference parameter is
* NUTAG_KEEPALIVE_REF()
*/
#define NUTAG_KEEPALIVE(x) nutag_keepalive, tag_uint_v(x)
extern tag_typedef_t nutag_keepalive;
#define NUTAG_KEEPALIVE_REF(x) nutag_keepalive_ref, tag_uint_vr(&(x))
extern tag_typedef_t nutag_keepalive_ref;
/** Transport-level keepalive interval for streams.
*
* @par Used with
* nua_register() \n
* nua_set_params() \n
* nua_get_params()
* nua_set_hparams() \n
* nua_get_hparams()
*
* @par Parameter type
* unsigned int
*
* @par Values
* Transport-level keepalive interval for streams.
*
* Corresponding tag taking reference parameter is
* NUTAG_KEEPALIVE_STREAM_REF()
*/
#define NUTAG_KEEPALIVE_STREAM(x) nutag_keepalive_stream, tag_uint_v(x)
extern tag_typedef_t nutag_keepalive_stream;
#define NUTAG_KEEPALIVE_STREAM_REF(x) \
nutag_keepalive_stream_ref, tag_uint_vr(&(x))
extern tag_typedef_t nutag_keepalive_stream_ref;
/** Lifetime of authentication data in seconds.
*
* @par Used with
......
......@@ -854,6 +854,12 @@ int test_params(struct context *ctx)
NUTAG_PATH_ENABLE(0),
NUTAG_SUBSTATE(nua_substate_pending),
NUTAG_KEEPALIVE(66),
NUTAG_KEEPALIVE_STREAM(33),
NUTAG_OUTBOUND("foo"),
NUTAG_INSTANCE("urn:uuid:97701ad9-39df-1229-1083-dbc0a85f029c"),
SIPTAG_SUPPORTED(sip_supported_make(tmphome, "humppaa,kuole")),
SIPTAG_ALLOW(sip_allow_make(tmphome, "OPTIONS, INFO")),
SIPTAG_USER_AGENT(sip_user_agent_make(tmphome, "test_nua")),
......@@ -911,6 +917,11 @@ int test_params(struct context *ctx)
sip_organization_t const *organization = NONE;
char const *organization_str = "NONE";
char const *outbound = "NONE";
char const *instance = "NONE";
unsigned keepalive = -1, keepalive_stream = -1;
url_string_t const *registrar = NONE;
int n;
......@@ -961,10 +972,16 @@ int test_params(struct context *ctx)
SIPTAG_ORGANIZATION_REF(organization),
SIPTAG_ORGANIZATION_STR_REF(organization_str),
NUTAG_OUTBOUND_REF(outbound),
NUTAG_INSTANCE_REF(instance),
NUTAG_KEEPALIVE_REF(keepalive),
NUTAG_KEEPALIVE_STREAM_REF(keepalive_stream),
NUTAG_REGISTRAR_REF(registrar),
TAG_END());
TEST(n, 30);
TEST(n, 34);
TEST_S(sip_header_as_string(tmphome, (void *)from), Alice);
TEST_S(from_str, Alice);
......@@ -1004,6 +1021,12 @@ int test_params(struct context *ctx)
"Pussy Galore's Flying Circus");
TEST_S(organization_str, "Pussy Galore's Flying Circus");
TEST(keepalive, 66);
TEST(keepalive_stream, 33);
TEST_S(outbound, "foo");
TEST_S(instance, "urn:uuid:97701ad9-39df-1229-1083-dbc0a85f029c");
TEST_S(url_as_string(tmphome, registrar->us_url),
"sip:sip.wonderland.org");
......
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