Commit 4bc5de8c authored by Pekka Pessi's avatar Pekka Pessi

Renamed register_usage as outbound_connect.

Added tags NUTAG_OUTBOUND(), NUTAG_OUTBOUND_SET1(), NUTAG_OUTBOUND_SET2(),
NUTAG_OUTBOUND_SET3(), and NUTAG_OUTBOUND_SET4().

darcs-hash:20060322133336-65a35-cb4d5ffeb5c77610fe179f6df23aaf81a09e66c8.gz
parent fb553cac
......@@ -109,8 +109,9 @@ int nua_stack_process_options(nua_t *nua,
int status = 200; char const *phrase = sip_200_OK;
if (register_usage_check_accept(sip->sip_accept))
return register_usage_process_options(nua->nua_registrations, irq, sip);
/* Hook to outbound */
if (outbound_connect_check_accept(sip->sip_accept))
return outbound_connect_process_options(nua->nua_registrations, irq, sip);
if (nh == NULL)
nh = nua->nua_dhandle;
......@@ -118,9 +119,9 @@ int nua_stack_process_options(nua_t *nua,
msg = nh_make_response(nua, nh, irq, status, phrase,
SIPTAG_ALLOW(NH_PGET(nh, allow)),
SIPTAG_SUPPORTED(NH_PGET(nh, supported)),
SIPTAG_ACCEPT_STR(SDP_MIME_TYPE),
TAG_IF(NH_PGET(nh, path_enable),
SIPTAG_SUPPORTED_STR("path")),
SIPTAG_ACCEPT_STR(SDP_MIME_TYPE),
TAG_END());
if (msg) {
......
This diff is collapsed.
......@@ -186,9 +186,6 @@ int nua_stack_init(su_root_t *root, nua_t *nua)
DNHP_SET(dnhp, auto_ack, 1);
DNHP_SET(dnhp, invite_timeout, 120);
DNHP_SET(dnhp, natify, 1);
DNHP_SET(dnhp, gruuize, 1);
DNHP_SET(dnhp, session_timer, 1800);
DNHP_SET(dnhp, min_se, 120);
DNHP_SET(dnhp, refresher, nua_no_refresher);
......@@ -213,6 +210,8 @@ int nua_stack_init(su_root_t *root, nua_t *nua)
DNHP_SET(dnhp, user_agent,
sip_user_agent_make(dnh->nh_home, PACKAGE_NAME "/" PACKAGE_VERSION));
DNHP_SET(dnhp, outbound, su_strdup(dnh->nh_home, "gruuize, outbound, natify, use-rport"));
/* Set initial nta parameters */
tl_gets(nua->nua_args,
NUTAG_URL_REF(contact),
......@@ -792,6 +791,9 @@ int nua_stack_set_params(nua_t *nua, nua_handle_t *nh, nua_event_t e,
sip_from_t const *from = NONE;
char const *from_str = NONE;
char const *instance = NONE;
char const *outbound = NONE;
#if HAVE_SOFIA_SMIME
int smime_enable = nua->sm->sm_enable;
int smime_opt = nua->sm->sm_opt;
......@@ -860,6 +862,9 @@ int nua_stack_set_params(nua_t *nua, nua_handle_t *nh, nua_event_t e,
SIPTAG_FROM_REF(from),
SIPTAG_FROM_STR_REF(from_str),
NUTAG_INSTANCE_REF(instance),
NUTAG_OUTBOUND_REF(outbound),
#if HAVE_SOFIA_SMIME
NUTAG_SMIME_ENABLE_REF(smime_enable),
NUTAG_SMIME_OPT_REF(smime_opt),
......@@ -986,6 +991,9 @@ int nua_stack_set_params(nua_t *nua, nua_handle_t *nh, nua_event_t e,
NHP_SET_STR(nhp, ua_name, ua_name);
NHP_SET_HEADER(nhp, organization, organization, organization_str);
NHP_SET_STR(nhp, instance, instance);
NHP_SET_STR(nhp, outbound, outbound);
if (n > 0 && NHP_IS_ANY_SET(nhp)) {
/* Move allocations from tmphome to handle's home */
if (nh != dnh && nh->nh_prefs == dnh->nh_prefs) {
......
......@@ -103,7 +103,7 @@ typedef struct nua_server_request nua_server_request_t;
typedef void nua_creq_restart_f(nua_handle_t *, tagi_t *tags);
typedef struct register_usage nua_registration_t;
typedef struct outbound_connect nua_registration_t;
struct nua_client_request
{
......@@ -208,9 +208,6 @@ typedef struct nua_handle_preferences
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 nhp_natify:1;
unsigned nhp_gruuize:1;
unsigned nhp_check_register:1;
unsigned :0;
/** INVITE timeout.
......@@ -258,6 +255,8 @@ typedef struct nua_handle_preferences
sip_organization_t *nhp_organization;
char const *nhp_instance;
/**< Outbound OPTIONS */
char const *nhp_outbound;
/* A bit for each feature set by application */
union {
......@@ -270,8 +269,6 @@ typedef struct nua_handle_preferences
unsigned nhp_early_media:1;
unsigned nhp_auto_answer:1;
unsigned nhp_auto_ack:1;
unsigned nhp_natify:1;
unsigned nhp_gruuize:1;
unsigned nhp_invite_timeout:1;
unsigned nhp_session_timer:1;
unsigned nhp_min_se:1;
......@@ -292,6 +289,7 @@ typedef struct nua_handle_preferences
unsigned nhp_ua_name:1;
unsigned nhp_organization:1;
unsigned nhp_instance;
unsigned nhp_outbound;
unsigned :0;
} set_bits;
} nhp_set;
......@@ -497,11 +495,11 @@ void nua_stack_signal(nua_t *nua, su_msg_r msg, event_t *e);
int nua_stack_registrations_init(nua_t *nua);
int register_usage_check_accept(sip_accept_t const *accept);
int outbound_connect_check_accept(sip_accept_t const *accept);
int register_usage_process_options(struct register_usage *usages,
nta_incoming_t *irq,
sip_t const *sip);
int outbound_connect_process_options(struct outbound_connect *usages,
nta_incoming_t *irq,
sip_t const *sip);
void nua_stack_post_signal(nua_handle_t *nh, nua_event_t event,
tag_type_t tag, tag_value_t value, ...);
......
......@@ -99,6 +99,12 @@ tag_typedef_t nutag_certificate_phrase = STRTAG_TYPEDEF(certificate_phrase);
tag_typedef_t nutag_registrar = URLTAG_TYPEDEF(registrar);
tag_typedef_t nutag_identity = PTRTAG_TYPEDEF(identity);
tag_typedef_t nutag_instance = STRTAG_TYPEDEF(instance);
tag_typedef_t nutag_outbound = STRTAG_TYPEDEF(outbound);
tag_typedef_t nutag_outbound_set1 = STRTAG_TYPEDEF(outbound_set1);
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_sip_parser = PTRTAG_TYPEDEF(sip_parser);
......
......@@ -770,6 +770,116 @@ extern tag_typedef_t nutag_registrar;
#define NUTAG_REGISTRAR_REF(x) nutag_registrar_ref, urltag_url_vr(&(x))
extern tag_typedef_t nutag_registrar_ref;
/** Outbound option string.
*
* @par Used with
* nua_register() \n
* nua_set_params() \n
* nua_get_params()
* nua_set_hparams() \n
* nua_get_hparams()
*
* @par Parameter type
* char const *
*
* @par Values
*
* Corresponding tag taking reference parameter is NUTAG_OUTBOUND_REF()
*/
#define NUTAG_OUTBOUND(x) nutag_outbound, tag_str_v(x)
extern tag_typedef_t nutag_outbound;
#define NUTAG_OUTBOUND_REF(x) nutag_outbound_ref, tag_str_vr(&(x))
extern tag_typedef_t nutag_outbound_ref;
/** Outbound proxy set 1.
*
* @par Used with
* nua_register() \n
* nua_set_params() \n
* nua_get_params()
* nua_set_hparams() \n
* nua_get_hparams()
*
* @par Parameter type
* char const *
*
* @par Values
*
* Corresponding tag taking reference parameter is NUTAG_OUTBOUND_SET1_REF()
*/
#define NUTAG_OUTBOUND_SET1(x) nutag_outbound_set1, tag_str_v(x)
extern tag_typedef_t nutag_outbound_set1;
#define NUTAG_OUTBOUND_SET1_REF(x) nutag_outbound_set1_ref, tag_str_vr(&(x))
extern tag_typedef_t nutag_outbound_set1_ref;
/** Outbound proxy set 2.
*
* @par Used with
* nua_register() \n
* nua_set_params() \n
* nua_get_params()
* nua_set_hparams() \n
* nua_get_hparams()
*
* @par Parameter type
* char const *
*
* @par Values
*
* Corresponding tag taking reference parameter is NUTAG_OUTBOUND_SET2_REF()
*/
#define NUTAG_OUTBOUND_SET2(x) nutag_outbound_set2, tag_str_v(x)
extern tag_typedef_t nutag_outbound_set2;
#define NUTAG_OUTBOUND_SET2_REF(x) nutag_outbound_set2_ref, tag_str_vr(&(x))
extern tag_typedef_t nutag_outbound_set2_ref;
/** Outbound proxy set 3.
*
* @par Used with
* nua_register() \n
* nua_set_params() \n
* nua_get_params()
* nua_set_hparams() \n
* nua_get_hparams()
*
* @par Parameter type
* char const *
*
* @par Values
*
* Corresponding tag taking reference parameter is NUTAG_OUTBOUND_SET3_REF()
*/
#define NUTAG_OUTBOUND_SET3(x) nutag_outbound_set3, tag_str_v(x)
extern tag_typedef_t nutag_outbound_set3;
#define NUTAG_OUTBOUND_SET3_REF(x) nutag_outbound_set3_ref, tag_str_vr(&(x))
extern tag_typedef_t nutag_outbound_set3_ref;
/** Outbound proxy set 4.
*
* @par Used with
* nua_register() \n
* nua_set_params() \n
* nua_get_params()
* nua_set_hparams() \n
* nua_get_hparams()
*
* @par Parameter type
* char const *
*
* @par Values
*
* Corresponding tag taking reference parameter is NUTAG_OUTBOUND_SET4_REF()
*/
#define NUTAG_OUTBOUND_SET4(x) nutag_outbound_set4, tag_str_v(x)
extern tag_typedef_t nutag_outbound_set4;
#define NUTAG_OUTBOUND_SET4_REF(x) nutag_outbound_set4_ref, tag_str_vr(&(x))
extern tag_typedef_t nutag_outbound_set4_ref;
/** Pointer to SIP parser structure
*
* @par Used with
......
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