Commit e1964eb9 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

nua_prefs.h, nua_prefs.c, nua_common.c, nua_stack.c: updated preference handling.

The preferences are now handled in a more consistent way. nua_create() calls
internally nua_set_params(). NUTAG_MEDIA_ENABLE() can be set handle-wise,
even in nua_invite() or in nua_respond().

darcs-hash:20060925213223-65a35-5287236c60c3846eb8c6368186d92653d5e5261c.gz
parent f622a97e
......@@ -89,7 +89,7 @@ static void nh_destructor(void *arg);
* @retval NULL Creation failed
*
* @par Related tags:
* Creates a copy of provided tags and they will
* Creates a copy of the provided tags which will
* be used with every operation.
*
* @par Events:
......@@ -98,7 +98,8 @@ static void nh_destructor(void *arg);
* @note
* This function is called by both stack and application sides.
*/
nua_handle_t *nh_create_handle(nua_t *nua, nua_hmagic_t *hmagic,
nua_handle_t *nh_create_handle(nua_t *nua,
nua_hmagic_t *hmagic,
tagi_t *tags)
{
nua_handle_t *nh;
......@@ -109,62 +110,17 @@ nua_handle_t *nh_create_handle(nua_t *nua, nua_hmagic_t *hmagic,
assert(nua->nua_home);
if ((nh = su_home_clone(nua->nua_home, sizeof(*nh)))) {
url_string_t const *url = NULL;
sip_to_t to[1];
sip_to_t const *p_to = NULL;
sip_from_t from[1];
sip_from_t const *p_from = NULL;
tl_gets(tags, /* These does not change while nh lives */
SIPTAG_FROM_REF(p_from),
SIPTAG_TO_REF(p_to),
NUTAG_URL_REF(url),
TAG_END());
if (!p_from && nua->nua_from) {
*from = *nua->nua_from;
from->a_params = NULL;
}
else {
p_from = (void *)-1;
}
nh->nh_prefs = nua->nua_dhandle->nh_prefs;
if (!p_to && url) {
void *tbf = NULL;
if (url_is_string(url))
url = tbf = url_hdup(nh->nh_home, url->us_url);
*sip_to_init(to)->a_url = *url->us_url;
to->a_url->url_params = NULL;
to->a_url->url_headers = NULL;
nh->nh_ds->ds_remote = sip_to_dup(nh->nh_home, to);
if (tbf)
su_free(nh->nh_home, tbf);
}
else {
p_to = (void *)-1;
}
nh->nh_valid = nua_handle;
nh->nh_nua = nua;
nh->nh_magic = hmagic;
nh->nh_tags = tl_tlist(nh->nh_home,
TAG_IF(!p_from, SIPTAG_FROM(from)),
TAG_IF(!p_to, SIPTAG_TO(to)),
TAG_NEXT(tags));
tl_gets(nh->nh_tags, /* These does not change while nh lives */
SIPTAG_FROM_REF(nh->nh_ds->ds_local),
SIPTAG_TO_REF(nh->nh_ds->ds_remote),
TAG_END());
nh->nh_prefs = nua->nua_dhandle->nh_prefs;
if (su_home_is_threadsafe(nua->nua_home)) {
if (nua_handle_save_tags(nh, tags) < 0) {
SU_DEBUG_5(("nua(%p): creating handle %p failed\n", nua, nh));
su_home_unref(nh->nh_home), nh = NULL;
}
if (nh && su_home_is_threadsafe(nua->nua_home)) {
if (su_home_threadsafe(nh->nh_home) < 0) {
su_home_unref(nh->nh_home);
nh = NULL;
......@@ -172,8 +128,9 @@ nua_handle_t *nh_create_handle(nua_t *nua, nua_hmagic_t *hmagic,
}
if (nh && _handle_lifetime) {
/* This far, we have nothing real to destruct */
/* This far, we have nothing real to destruct but
* when _NUA_HANDLE_DEBUG is set, we add destructor
* and get more entertaining debugging output */
if (_handle_lifetime == 1 && !getenv("_NUA_HANDLE_DEBUG")) {
_handle_lifetime = 0;
}
......
This diff is collapsed.
......@@ -35,12 +35,29 @@
* @date Created: Wed Mar 8 11:38:18 EET 2006 ppessi
*/
/** NUA preferences.
*
* This structure contains values for various preferences and a separate
* bitmap (nhp_set) for each preference. Preferences are set using
* nua_set_params() or nua_set_hparams() or a handle-specific operation
* setting the preferences, including nua_invite(), nua_respond(),
* nua_ack(), nua_prack(), nua_update(), nua_info(), nua_bye(),
* nua_options(), nua_message(), nua_register(), nua_publish(), nua_refer(),
* nua_subscribe(), nua_notify(), nua_refer(), and nua_notifier().
*
* The stack uses preference value if corresponding bit in bitmap is set,
* otherwise it uses preference value from default handle.
*
* @see NHP_GET(), NH_PGET(), NHP_ISSET(), NH_PISSET()
*/
typedef struct nua_handle_preferences
{
unsigned nhp_retry_count; /**< times to retry a request */
unsigned nhp_max_subscriptions;
/* Session-related preferences */
char const *nhp_soa_name;
unsigned nhp_media_enable:1;
unsigned nhp_invite_enable:1;
unsigned nhp_auto_alert:1;
unsigned nhp_early_media:1;/**< Establish early media session */
......@@ -55,10 +72,6 @@ typedef struct nua_handle_preferences
* 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 */
......@@ -92,11 +105,14 @@ typedef struct nua_handle_preferences
/* Subscriber state, i.e. nua_substate_pending */
unsigned nhp_substate;
/* REGISTER Keepalive intervals */
unsigned nhp_keepalive, nhp_keepalive_stream;
char const *nhp_registrar;
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_user_agent;
char const *nhp_organization;
char const *nhp_m_display;
char const *nhp_m_username;
......@@ -106,14 +122,17 @@ typedef struct nua_handle_preferences
/**< Outbound OPTIONS */
char const *nhp_outbound;
/**< Network detection: NONE, INFORMAL, TRY_FULL */
uint32_t nhp_detect_network_updates;
int nhp_detect_network_updates;
/* A bit for each feature set by application */
struct {
unsigned nhb_retry_count:1;
unsigned nhb_max_subscriptions:1;
unsigned nhb_soa_name:1;
unsigned nhb_media_enable:1;
unsigned nhb_invite_enable:1;
unsigned nhb_auto_alert:1;
unsigned nhb_early_media:1;
......@@ -121,8 +140,7 @@ typedef struct nua_handle_preferences
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;
......@@ -137,14 +155,18 @@ typedef struct nua_handle_preferences
unsigned nhb_refer_with_id:1;
unsigned nhb_refer_expires:1;
unsigned nhb_substate:1;
unsigned nhb_keepalive:1;
unsigned nhb_keepalive_stream:1;
unsigned nhb_registrar:1;
unsigned nhb_allow:1;
unsigned nhb_supported:1;
unsigned nhb_user_agent:1;
unsigned nhb_ua_name:1;
unsigned nhb_organization:1;
unsigned :0; /* at most 32 bits ... */
unsigned nhb_m_display:1;
unsigned nhb_m_username:1;
unsigned :0;
unsigned nhb_m_params:1;
unsigned nhb_m_features:1;
unsigned nhb_instance:1;
......
......@@ -702,7 +702,7 @@ int nua_stack_ack(nua_t *nua, nua_handle_t *nh, nua_event_t e,
received = NULL;
if (tags) {
nua_stack_set_params(nua, nh, nua_r_ack, tags);
nua_stack_set_params(nua, nh, nua_i_error, tags);
}
msg = nua_creq_msg(nua, nh, cr, 0,
......@@ -1172,7 +1172,7 @@ nua_stack_cancel(nua_t *nua, nua_handle_t *nh, nua_event_t e,
nua_client_request_t *crc = nh->nh_cr;
if (tags)
nua_stack_set_params(nua, nh, nua_r_cancel, tags);
nua_stack_set_params(nua, nh, nua_i_error, tags);
if (nh && cri->cr_orq && cri->cr_usage) {
nta_outgoing_t *orq;
......@@ -1258,7 +1258,7 @@ int process_invite1(nua_t *nua,
int have_sdp;
char const *sdp;
size_t len;
sip_user_agent_t const *user_agent = NH_PGET(nh0, user_agent);
char const *user_agent = NH_PGET(nh0, user_agent);
#if HAVE_SOFIA_SMIME
int sm_status;
......@@ -1281,7 +1281,7 @@ int process_invite1(nua_t *nua,
/* Make sure caller uses application/sdp without compression */
if (nta_check_session_content(irq, sip,
nua->nua_invite_accept,
SIPTAG_USER_AGENT(user_agent),
SIPTAG_USER_AGENT_STR(user_agent),
SIPTAG_ACCEPT_ENCODING_STR(""),
TAG_END()))
return 415;
......@@ -1290,7 +1290,7 @@ int process_invite1(nua_t *nua,
if (nta_check_accept(irq, sip,
nua->nua_invite_accept,
NULL,
SIPTAG_USER_AGENT(user_agent),
SIPTAG_USER_AGENT_STR(user_agent),
SIPTAG_ACCEPT_ENCODING_STR(""),
TAG_END()))
return 406;
......@@ -1300,7 +1300,7 @@ int process_invite1(nua_t *nua,
unsigned min_se = nh ? nh->nh_ss->ss_min_se : DNH_PGET(dnh, min_se);
if (nta_check_session_expires(irq, sip,
min_se,
SIPTAG_USER_AGENT(user_agent),
SIPTAG_USER_AGENT_STR(user_agent),
TAG_END()))
return 500; /* respond with 500 Internal Server Error */
}
......@@ -1475,7 +1475,7 @@ void respond_to_invite(nua_t *nua, nua_handle_t *nh,
assert(ss->ss_usage);
if (tags) {
nua_stack_set_params(nua, nh, nua_i_invite, tags);
nua_stack_set_params(nua, nh, nua_i_error, tags);
if (status < 200) {
early_answer = -1;
......
......@@ -112,11 +112,7 @@ char const nua_application_sdp[] = "application/sdp";
int nua_stack_init(su_root_t *root, nua_t *nua)
{
su_home_t *home;
nua_handle_t *dnh;
int media_enable = 1;
soa_session_t *soa = NULL;
char const *soa_name = NULL;
static int initialized_logs = 0;
......@@ -137,6 +133,10 @@ int nua_stack_init(su_root_t *root, nua_t *nua)
}
nua->nua_root = root;
nua->nua_timer = su_timer_create(su_root_task(root),
NUA_STACK_TIMER_INTERVAL);
if (!nua->nua_timer)
return -1;
home = nua->nua_home;
nua->nua_handles_tail = &nua->nua_handles;
......@@ -152,13 +152,14 @@ int nua_stack_init(su_root_t *root, nua_t *nua)
nua_handle_ref(dnh); dnh->nh_ref_by_stack = 1;
nua_handle_ref(dnh); dnh->nh_ref_by_user = 1;
nh_append(nua, dnh);
dnh->nh_identity = dnh;
dnh->nh_ds->ds_local = nua->nua_from;
dnh->nh_ds->ds_remote = nua->nua_from;
if (nua_stack_set_defaults(dnh, dnh->nh_prefs) < 0)
return -1;
if (nua_stack_init_instance(dnh, nua->nua_args) < 0)
if (nua_stack_set_params(nua, dnh, nua_i_none, nua->nua_args) < 0)
return -1;
nua->nua_invite_accept = sip_accept_make(home, SDP_MIME_TYPE);
......@@ -183,32 +184,14 @@ int nua_stack_init(su_root_t *root, nua_t *nua)
nta_agent_set_params(nua->nua_nta, NTATAG_UA(1), TAG_END()) < 0 ||
nua_stack_init_transport(nua, nua->nua_args) < 0) {
SU_DEBUG_1(("nua: initializing SIP stack failed\n"));
return -1;
}
if (nua_stack_set_from(nua, 1, nua->nua_args) < 0)
return -1;
/* Set initial nta/soa parameters */
if (tl_gets(nua->nua_args,
NUTAG_MEDIA_ENABLE_REF(media_enable),
NUTAG_SOA_NAME_REF(soa_name),
TAG_NULL()) < 0)
return -1;
nua->nua_media_enable = media_enable;
if (media_enable) {
if (soa == NULL)
soa = soa_create(soa_name, nua->nua_root, nua->nua_dhandle);
dnh->nh_soa = soa;
soa_set_params(soa, TAG_NEXT(nua->nua_args));
}
nua->nua_timer = su_timer_create(su_root_task(root),
NUA_STACK_TIMER_INTERVAL);
if (!nua->nua_timer)
return -1;
if (NHP_ISSET(dnh->nh_prefs, detect_network_updates))
nua_stack_launch_network_change_detector(nua);
nua_stack_timer(nua, nua->nua_timer, NULL);
......@@ -253,7 +236,7 @@ int nua_stack_event(nua_t *nua, nua_handle_t *nh, msg_t *msg,
ta_list ta;
size_t e_len, len, xtra, p_len;
if (event == nua_r_ack)
if (event == nua_r_ack || event == nua_i_none)
return event;
enter;
......@@ -344,6 +327,7 @@ void nua_stack_signal(nua_t *nua, su_msg_r msg, nua_event_data_t *e)
if (!nh->nh_prev)
nh_append(nua, nh);
if (!nh->nh_ref_by_stack) {
/* Mark handle as used by stack */
nh->nh_ref_by_stack = 1;
nua_handle_ref(nh);
}
......@@ -720,7 +704,7 @@ void nua_creq_deinit(struct nua_client_request *cr, nta_outgoing_t *orq)
/* ======================================================================== */
/**@internal
* Initialize handle Allow and authentication info.
* Initialize handle Allow and authentication info, save parameters.
*
* @retval -1 upon an error
* @retval 0 when successful
......@@ -756,14 +740,6 @@ int nua_stack_init_handle(nua_t *nua, nua_handle_t *nh,
if (nua_stack_set_params(nua, nh, nua_i_error, ta_args(ta)) < 0)
retval = -1;
if (!retval && !nh->nh_soa && nua->nua_dhandle->nh_soa) {
nh->nh_soa = soa_clone(nua->nua_dhandle->nh_soa, nua->nua_root, nh);
if (nh->nh_soa && nh->nh_tags)
if (soa_set_params(nh->nh_soa, TAG_NEXT(nh->nh_tags)))
retval = -1;
}
if (!retval && nh->nh_soa)
if (soa_set_params(nh->nh_soa, ta_tags(ta)) < 0)
retval = -1;
......@@ -773,11 +749,6 @@ int nua_stack_init_handle(nua_t *nua, nua_handle_t *nh,
if (retval || nh->nh_init) /* Already initialized? */
return retval;
#if HAVE_UICC_H
if (nh->nh_has_register && nua->nua_uicc)
auc_with_uicc(&nh->nh_auth, nh->nh_home, nua->nua_uicc);
#endif
if (nh->nh_tags)
nh_authorize(nh, TAG_NEXT(nh->nh_tags));
......@@ -810,6 +781,7 @@ nua_handle_t *nua_stack_incoming_handle(nua_t *nua,
else
url = sip->sip_from->a_url;
/* Strip away parameters */
sip_from_init(from)->a_display = sip->sip_to->a_display;
*from->a_url = *sip->sip_to->a_url;
......@@ -817,9 +789,9 @@ nua_handle_t *nua_stack_incoming_handle(nua_t *nua,
*to->a_url = *sip->sip_from->a_url;
nh = nh_create(nua,
NUTAG_URL((url_string_t *)url),
SIPTAG_TO(to), /* Local address */
SIPTAG_FROM(from), /* Remote address */
NUTAG_URL((url_string_t *)url), /* Remote target */
SIPTAG_TO(to), /* Local AoR */
SIPTAG_FROM(from), /* Remote AoR */
TAG_END());
if (nua_stack_init_handle(nh->nh_nua, nh, kind, default_allow,
......@@ -965,6 +937,25 @@ msg_t *nua_creq_msg(nua_t *nua,
msg_destroy(cr->cr_msg), cr->cr_msg = NULL;
}
msg = nta_msg_create(nua->nua_nta, 0);
/**@par Populating SIP Request Message with Tagged Arguments
*
* The tagged arguments can be used to pass values for any SIP headers
* to the stack. When the INVITE message (or any other SIP message) is
* created, the tagged values saved with nua_handle() are used first,
* next the tagged values given with the operation (nua_invite()) are
* added.
*
* When multiple tags for the same header are specified, the behaviour
* depends on the header type. If only a single header field can be
* included in a SIP message, the latest non-NULL value is used, e.g.,
* @Subject. However, if the SIP header can consist of multiple lines or
* header fields separated by comma, e.g., @Accept, all the tagged
* values are concatenated.
*
* However, if a tag value is #SIP_NONE (-1 casted as a void pointer),
* the values from previous tags are ignored.
*/
tl_gets(nh->nh_tags, NUTAG_URL_REF(url), TAG_END());
sip_add_tl(msg, sip_object(msg), TAG_NEXT(nh->nh_tags));
}
......@@ -974,22 +965,42 @@ msg_t *nua_creq_msg(nua_t *nua,
sip = sip_object(msg);
if (!sip)
goto error;
if (sip_add_tl(msg, sip, ta_tags(ta)) < 0)
goto error;
if (method != sip_method_ack) {
/**
* Next, values previously set with nua_set_params() or nua_set_hparams()
* are used: @Allow, @Supported, @Organization, and @UserAgent headers are
* added to the request if they are not already set.
*/
if (!sip->sip_allow && !ds->ds_remote_tag)
sip_add_dup(msg, sip, (sip_header_t*)NH_PGET(nh, allow));
if (!sip->sip_supported && NH_PGET(nh, supported))
sip_add_dup(msg, sip, (sip_header_t *)NH_PGET(nh, supported));
if (method == sip_method_register && NH_PGET(nh, path_enable) &&
!sip_has_feature(sip->sip_supported, "path") &&
!sip_has_feature(sip->sip_require, "path"))
sip_add_make(msg, sip, sip_supported_class, "path");
if (!sip->sip_organization && NH_PGET(nh, organization))
sip_add_dup(msg, sip, (sip_header_t *)NH_PGET(nh, organization));
if (!sip->sip_user_agent && NH_PGET(nh, user_agent))
sip_add_make(msg, sip, sip_user_agent_class, NH_PGET(nh, user_agent));
}
{
tl_gets(ta_args(ta),
NUTAG_URL_REF(url),
NUTAG_USE_DIALOG_REF(use_dialog),
/* NUTAG_COPY_REF(copy), */
NUTAG_ADD_CONTACT_REF(add_contact),
TAG_END());
if (method == sip_method_register && url == NULL && !sip->sip_request) {
tl_gets(ta_args(ta), NUTAG_REGISTRAR_REF(url), TAG_END());
if (url == NULL)
tl_gets(nh->nh_tags, NUTAG_REGISTRAR_REF(url), TAG_END());
if (url == NULL)
url = (url_string_t *)nua->nua_registrar;
}
if (method == sip_method_register && url == NULL)
url = (url_string_t const *)NH_PGET(nh, registrar);
if (seq != -1) {
sip_cseq_t *cseq;
......@@ -1006,18 +1017,20 @@ msg_t *nua_creq_msg(nua_t *nua,
sip_header_insert(msg, sip, (sip_header_t *)cseq);
}
if (ds->ds_leg) {
add_service_route = 0;
/* If leg has established route, use it, not original URL */
if (ds->ds_route)
url = NULL;
if (sip_add_tl(msg, sip, ta_tags(ta)) < 0 ||
nta_msg_request_complete(msg, ds->ds_leg, method, name, url) < 0)
goto error;
}
else {
/**
* Now, the target URI for the request needs to be determined.
*
* For initial requests, values from tags are used. If NUTAG_URL() is
* given, it is used as target URI. Otherwise, if SIPTAG_TO() is given,
* it is used as target URI. If neither is given, the complete request
* line already specified using SIPTAG_REQUEST() or SIPTAG_REQUEST_STR()
* is used. At this point, the target URI is stored in the request line,
* together with method name and protocol version ("SIP/2.0"). The
* initial dialog information is also created: @CallID, @CSeq headers
* are generated, if they do not exist, and a tag is added to the @From
* header.
*/
if (!ds->ds_leg) {
nta_leg_t *leg = nua->nua_dhandle->nh_ds->ds_leg;
if (sip_add_tl(msg, sip, ta_tags(ta)) < 0
......@@ -1051,10 +1064,36 @@ msg_t *nua_creq_msg(nua_t *nua,
add_service_route = !restart;
}
else {
/**
* For in-dialog requests, the request URI is taken from the @Contact
* header received from the remote party during dialog establishment,
* and the NUTAG_URL() is ignored.
*/
if (ds->ds_route)
url = NULL;
/*
* If application did not specify an empty contact,
* use contact generated by stack.
/**Also, the @CallID and @CSeq headers and @From and @To tags are
* generated based on the dialog information and added to the request.
* If the dialog has a route, it is added to the request, too.
*/
if (nta_msg_request_complete(msg, ds->ds_leg, method, name, url) < 0)
goto error;
add_service_route = 0;
}
/***
* @MaxForwards header (with default value set by NTATAG_MAX_FORWARDS()) is
* also added now, if it does not exist.
*/
/**
* Next, the stack generates a @Contact header for the request (unless
* the application already gave a @Contact header or it does not want to
* use @Contact and indicates that by including SIPTAG_CONTACT(NULL) or
* SIPTAG_CONTACT(SIP_NONE) in the tagged parameters.) If the
* application has registered the URI in @From header, the @Contact
* header used with registration is used. Otherwise, the @Contact header
* is generated from the local IP address and port number.
*/
if (!add_contact ||
sip->sip_contact ||
......@@ -1064,6 +1103,9 @@ msg_t *nua_creq_msg(nua_t *nua,
tl_find(ta_args(ta), siptag_contact_str))
add_contact = 0;
/**For the initial requests, @ServiceRoute set received from the registrar
* is also added to the request message.
*/
if (add_contact || add_service_route) {
if (nua_registration_add_contact_to_request(nh, msg, sip,
add_contact,
......@@ -1071,29 +1113,13 @@ msg_t *nua_creq_msg(nua_t *nua,
goto error;
}
if (!sip->sip_user_agent && NH_PGET(nh, user_agent))
sip_add_dup(msg, sip, (sip_header_t *)NH_PGET(nh, user_agent));
if (method != sip_method_ack) {
if (!sip->sip_allow && !ds->ds_remote_tag)
sip_add_dup(msg, sip, (sip_header_t*)NH_PGET(nh, allow));
if (!sip->sip_supported && NH_PGET(nh, supported))
sip_add_dup(msg, sip, (sip_header_t *)NH_PGET(nh, supported));
if (method == sip_method_register && NH_PGET(nh, path_enable) &&
!sip_has_feature(sip->sip_supported, "path") &&
!sip_has_feature(sip->sip_require, "path"))
sip_add_make(msg, sip, sip_supported_class, "path");
if (!sip->sip_organization && NH_PGET(nh, organization))
sip_add_dup(msg, sip, (sip_header_t *)NH_PGET(nh, organization));
if (nh->nh_auth) {
nh_authorize(nh, ta_tags(ta));
if (method != sip_method_invite &&
method != sip_method_update &&
method != sip_method_prack &&
/* auc_authorize() removes existing authentication headers */
auc_authorize(&nh->nh_auth, msg, sip) < 0)
goto error;
......@@ -1189,7 +1215,8 @@ msg_t *nh_make_response(nua_t *nua,
sip_add_dup(msg, sip, (sip_header_t *)NH_PGET(nh, supported)) < 0)
msg_destroy(msg);
else if (!sip->sip_user_agent && NH_PGET(nh, user_agent) &&
sip_add_dup(msg, sip, (sip_header_t *)NH_PGET(nh, user_agent)) < 0)
sip_add_make(msg, sip, sip_user_agent_class,
NH_PGET(nh, user_agent)) < 0)
msg_destroy(msg);
else if (!sip->sip_organization && NH_PGET(nh, organization) &&
sip_add_dup(msg, sip, (sip_header_t *)NH_PGET(nh, organization)) < 0)
......@@ -1539,7 +1566,7 @@ int nua_stack_process_request(nua_handle_t *nh,
{
nua_t *nua = nh->nh_nua;
sip_method_t method = sip->sip_request->rq_method;