提交 7dc80a7d authored 作者: Michael Jerris's avatar Michael Jerris

revert some patches:

Tue Feb 26 13:02:06 EST 2008  Pekka.Pessi@nokia.com
  * nua_session.c: determine INVITE overlap with re-INVITEs, too

Tue Feb 26 12:45:52 EST 2008  Pekka.Pessi@nokia.com
  * test_nua.c: fixed tests

Tue Feb 26 11:40:00 EST 2008  Pekka.Pessi@nokia.com
  * nua_session.c: fixed non-compiling fix on session state check

Mon Feb 25 14:14:15 EST 2008  Pekka.Pessi@nokia.com
  * nua: added NUTAG_SUB_EXPIRES()

Wed Feb  6 12:05:46 EST 2008  Pekka.Pessi@nokia.com
  * nua: using global preferences. Added NUTAG_SHUTDOWN_EVENTS().

Wed Feb  6 12:05:13 EST 2008  Pekka.Pessi@nokia.com
  * nua_stack.c: pass events while in shutdown if NUTAG_SHUTDOWN_EVENTS(1) has been set

Mon Feb 25 09:49:39 EST 2008  Pekka.Pessi@nokia.com
  * nua_subnotref.c: fixed problems re-calculating the subscription duration upon NOTIFY
  
  Thanks for Colin Whittaker for reporting this problem.

Wed Feb 13 09:23:24 EST 2008  Pekka Pessi <Pekka.Pessi@nokia.com>
  * nua_subnotref.c: do not terminate subscriptions immediately after receiving 200 OK to un-SUBSCRIBE



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7757 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 b649fbfe
...@@ -237,8 +237,7 @@ int nua_subscribe_server_preprocess(nua_server_request_t *sr) ...@@ -237,8 +237,7 @@ int nua_subscribe_server_preprocess(nua_server_request_t *sr)
sip_event_t *o = sip->sip_event; sip_event_t *o = sip->sip_event;
char const *event = o ? o->o_type : NULL; char const *event = o ? o->o_type : NULL;
/* Maximum expiration time */ /* Maximum expiration time */
unsigned long expires = sip->sip_expires ? sip->sip_expires->ex_delta : 3600; unsigned long expires = 3600;
sip_time_t now = sip_now();
assert(nh && nh->nh_nua->nua_dhandle != nh); assert(nh && nh->nh_nua->nua_dhandle != nh);
...@@ -260,10 +259,9 @@ int nua_subscribe_server_preprocess(nua_server_request_t *sr) ...@@ -260,10 +259,9 @@ int nua_subscribe_server_preprocess(nua_server_request_t *sr)
nu = nua_dialog_usage_private(du); nu = nua_dialog_usage_private(du);
if (now + expires >= now) if (sip->sip_expires && sip->sip_expires->ex_delta < expires)
nu->nu_requested = now + expires; expires = sip->sip_expires->ex_delta;
else nu->nu_requested = sip_now() + expires;
nu->nu_requested = SIP_TIME_MAX - 1;
#if SU_HAVE_EXPERIMENTAL #if SU_HAVE_EXPERIMENTAL
nu->nu_etags = nu->nu_etags =
...@@ -297,23 +295,9 @@ int nua_subscribe_server_respond(nua_server_request_t *sr, tagi_t const *tags) ...@@ -297,23 +295,9 @@ int nua_subscribe_server_respond(nua_server_request_t *sr, tagi_t const *tags)
sip_time_t now = sip_now(); sip_time_t now = sip_now();
if (nu->nu_requested) { if (nu->nu_requested) {
if (sip->sip_expires) { if (nu->nu_requested > nu->nu_expires)
/* Expires in response can only shorten the expiration time */
if (nu->nu_requested > now + sip->sip_expires->ex_delta)
nu->nu_requested = now + sip->sip_expires->ex_delta;
}
else {
unsigned sub_expires = NH_PGET(sr->sr_owner, sub_expires);
if (nu->nu_requested > now + sub_expires)
nu->nu_requested = now + sub_expires;
}
if (nu->nu_requested >= now)
nu->nu_expires = nu->nu_requested; nu->nu_expires = nu->nu_requested;
else else if (nu->nu_expires <= now || nu->nu_requested <= now)
nu->nu_expires = now;
if (nu->nu_expires <= now)
nu->nu_substate = nua_substate_terminated; nu->nu_substate = nua_substate_terminated;
} }
...@@ -321,7 +305,7 @@ int nua_subscribe_server_respond(nua_server_request_t *sr, tagi_t const *tags) ...@@ -321,7 +305,7 @@ int nua_subscribe_server_respond(nua_server_request_t *sr, tagi_t const *tags)
ex->ex_delta = nu->nu_expires - now; ex->ex_delta = nu->nu_expires - now;
} }
else { else {
/* Always add header Expires: 0 */ /* Add header Expires: 0 */
} }
if (!sip->sip_expires || sip->sip_expires->ex_delta > ex->ex_delta) if (!sip->sip_expires || sip->sip_expires->ex_delta > ex->ex_delta)
......
...@@ -107,7 +107,6 @@ typedef struct nua_handle_preferences ...@@ -107,7 +107,6 @@ typedef struct nua_handle_preferences
/* Subscriber state, i.e. nua_substate_pending */ /* Subscriber state, i.e. nua_substate_pending */
unsigned nhp_substate; unsigned nhp_substate;
unsigned nhp_sub_expires;
/* REGISTER keepalive intervals */ /* REGISTER keepalive intervals */
unsigned nhp_keepalive, nhp_keepalive_stream; unsigned nhp_keepalive, nhp_keepalive_stream;
...@@ -128,6 +127,9 @@ typedef struct nua_handle_preferences ...@@ -128,6 +127,9 @@ typedef struct nua_handle_preferences
/** Outbound OPTIONS */ /** Outbound OPTIONS */
char const *nhp_outbound; char const *nhp_outbound;
/** Network detection: NONE, INFORMAL, TRY_FULL */
int nhp_detect_network_updates;
sip_allow_t *nhp_appl_method; sip_allow_t *nhp_appl_method;
/** Initial route set */ /** Initial route set */
...@@ -135,12 +137,6 @@ typedef struct nua_handle_preferences ...@@ -135,12 +137,6 @@ typedef struct nua_handle_preferences
union { struct { union { struct {
/* A bit for each feature set by application */ /* A bit for each feature set by application */
/* NOTE:
Some compilers behave weird if there are bitfields
together with width > 32
So there should be a padding field (unsigned:0;)
every 32 bits.
*/
unsigned nhb_retry_count:1; unsigned nhb_retry_count:1;
unsigned nhb_max_subscriptions:1; unsigned nhb_max_subscriptions:1;
...@@ -170,15 +166,13 @@ typedef struct nua_handle_preferences ...@@ -170,15 +166,13 @@ typedef struct nua_handle_preferences
unsigned nhb_refer_with_id:1; unsigned nhb_refer_with_id:1;
unsigned nhb_refer_expires:1; unsigned nhb_refer_expires:1;
unsigned nhb_substate:1; unsigned nhb_substate:1;
unsigned nhb_sub_expires:1;
unsigned nhb_keepalive:1; unsigned nhb_keepalive:1;
unsigned nhb_keepalive_stream:1; unsigned nhb_keepalive_stream:1;
unsigned nhb_registrar:1; unsigned nhb_registrar:1;
unsigned nhb_allow:1; unsigned nhb_allow:1;
unsigned :0; /* at most 32 bits before this point */
unsigned nhb_supported:1; unsigned nhb_supported:1;
unsigned :0; /* at most 32 bits ... */
unsigned nhb_allow_events:1; unsigned nhb_allow_events:1;
unsigned nhb_user_agent:1; unsigned nhb_user_agent:1;
unsigned nhb_organization:1; unsigned nhb_organization:1;
...@@ -189,6 +183,7 @@ typedef struct nua_handle_preferences ...@@ -189,6 +183,7 @@ typedef struct nua_handle_preferences
unsigned nhb_m_features:1; unsigned nhb_m_features:1;
unsigned nhb_instance:1; unsigned nhb_instance:1;
unsigned nhb_outbound:1; unsigned nhb_outbound:1;
unsigned nhb_detect_network_updates:1;
unsigned nhb_appl_method:1; unsigned nhb_appl_method:1;
unsigned nhb_initial_route:1; unsigned nhb_initial_route:1;
unsigned :0; unsigned :0;
...@@ -199,26 +194,6 @@ typedef struct nua_handle_preferences ...@@ -199,26 +194,6 @@ typedef struct nua_handle_preferences
#define nhp_set nhp_set_.set_bits #define nhp_set nhp_set_.set_bits
/** Global preferences for nua. */
typedef struct {
/** Network detection: NONE, INFORMAL, TRY_FULL */
signed int ngp_detect_network_updates:3;
/** Pass events during shutdown, too */
int ngp_shutdown_events:1;
unsigned :0; /* pad */
union { struct {
/* A bit for each feature set by application */
unsigned ngp_detect_network_updates:1;
unsigned ngp_shutdown_events:1;
unsigned :0;
} set_bits;
unsigned set_unsigned[2];
} ngp_set_;
} nua_global_preferences_t;
#define ngp_set ngp_set_.set_bits
#define DNHP_GET(dnhp, pref) ((dnhp)->nhp_##pref) #define DNHP_GET(dnhp, pref) ((dnhp)->nhp_##pref)
#define NHP_GET(nhp, dnhp, pref) \ #define NHP_GET(nhp, dnhp, pref) \
......
...@@ -1854,8 +1854,9 @@ nua_invite_server_init(nua_server_request_t *sr) ...@@ -1854,8 +1854,9 @@ nua_invite_server_init(nua_server_request_t *sr)
nua_client_request_t const *cr; nua_client_request_t const *cr;
for (sr0 = nh->nh_ds->ds_sr; sr0; sr0 = sr0->sr_next) { for (sr0 = nh->nh_ds->ds_sr; sr0; sr0 = sr0->sr_next) {
/* Previous INVITE has not been ACKed */ /* Final response have not been sent to previous INVITE */
if (sr0->sr_method == sip_method_invite) if (sr0->sr_method == sip_method_invite &&
nua_server_request_is_pending(sr0))
break; break;
/* Or we have sent offer but have not received an answer */ /* Or we have sent offer but have not received an answer */
if (sr->sr_sdp && sr0->sr_offer_sent && !sr0->sr_answer_recv) if (sr->sr_sdp && sr0->sr_offer_sent && !sr0->sr_answer_recv)
...@@ -1878,8 +1879,10 @@ nua_invite_server_init(nua_server_request_t *sr) ...@@ -1878,8 +1879,10 @@ nua_invite_server_init(nua_server_request_t *sr)
ss = nua_dialog_usage_private(sr->sr_usage); ss = nua_dialog_usage_private(sr->sr_usage);
if (ss->ss_state < nua_callstate_ready && if (ss->ss_state < nua_callstate_completed &&
ss->ss_state != nua_callstate_init) { ss->ss_state != nua_callstate_init) {
/* We should never trigger this,
but better not to assert() on network input */
return nua_server_retry_after(sr, 500, "Overlapping Requests 2", 0, 10); return nua_server_retry_after(sr, 500, "Overlapping Requests 2", 0, 10);
} }
} }
...@@ -1914,7 +1917,7 @@ nua_session_server_init(nua_server_request_t *sr) ...@@ -1914,7 +1917,7 @@ nua_session_server_init(nua_server_request_t *sr)
else if (sr->sr_usage) { else if (sr->sr_usage) {
nua_session_usage_t *ss = nua_dialog_usage_private(sr->sr_usage); nua_session_usage_t *ss = nua_dialog_usage_private(sr->sr_usage);
if (ss->ss_state >= nua_callstate_terminating) if (ss->ss_state >= nua_callstate_terminating)
return SR_STATUS(sr, 481, "Call is being terminated"); return SR_STATUS1(sr, 481, "Call is being terminated");
} }
if (nh->nh_soa) { if (nh->nh_soa) {
......
...@@ -209,7 +209,7 @@ int nua_stack_init(su_root_t *root, nua_t *nua) ...@@ -209,7 +209,7 @@ int nua_stack_init(su_root_t *root, nua_t *nua)
if (nua_stack_set_from(nua, 1, nua->nua_args) < 0) if (nua_stack_set_from(nua, 1, nua->nua_args) < 0)
return -1; return -1;
if (nua->nua_prefs->ngp_detect_network_updates) if (NHP_ISSET(dnh->nh_prefs, detect_network_updates))
nua_stack_launch_network_change_detector(nua); nua_stack_launch_network_change_detector(nua);
nua_stack_timer(nua, nua->nua_timer, NULL); nua_stack_timer(nua, nua->nua_timer, NULL);
...@@ -293,8 +293,7 @@ int nua_stack_event(nua_t *nua, nua_handle_t *nh, msg_t *msg, ...@@ -293,8 +293,7 @@ int nua_stack_event(nua_t *nua, nua_handle_t *nh, msg_t *msg,
if ((event > nua_r_authenticate && event <= nua_r_ack) if ((event > nua_r_authenticate && event <= nua_r_ack)
|| event < nua_i_error || event < nua_i_error
|| (nh && !nh->nh_valid) || (nh && !nh->nh_valid)
|| (nua->nua_shutdown && event != nua_r_shutdown && || (nua->nua_shutdown && event != nua_r_shutdown)) {
!nua->nua_prefs->ngp_shutdown_events)) {
if (msg) if (msg)
msg_destroy(msg); msg_destroy(msg);
return event; return event;
......
...@@ -217,31 +217,28 @@ struct nua_s { ...@@ -217,31 +217,28 @@ struct nua_s {
su_clone_r nua_clone; su_clone_r nua_clone;
su_task_r nua_client; su_task_r nua_client;
su_network_changed_t *nua_nw_changed;
nua_callback_f nua_callback; nua_callback_f nua_callback;
nua_magic_t *nua_magic; nua_magic_t *nua_magic;
nua_event_frame_t *nua_current; nua_event_frame_t *nua_current;
nua_saved_event_t nua_signal[1]; nua_saved_event_t nua_signal[1];
/**< Used by stop-and-wait args calls */
tagi_t const *nua_args;
/* Engine state flags */ /* Engine state flags */
sip_time_t nua_shutdown;
unsigned nua_shutdown_started:1; /**< Shutdown initiated */ unsigned nua_shutdown_started:1; /**< Shutdown initiated */
unsigned nua_shutdown_final:1; /**< Shutdown is complete */ unsigned nua_shutdown_final:1; /**< Shutdown is complete */
unsigned nua_from_is_set; unsigned nua_from_is_set;
unsigned :0; unsigned :0;
/**< Local SIP address. Contents are kept around for ever. */ /**< Used by stop-and-wait args calls */
sip_from_t nua_from[1]; tagi_t const *nua_args;
/* ---------------------------------------------------------------------- */ /**< Local SIP address. Contents are kept around for ever. */
sip_from_t nua_from[1];
/* Protocol (server) side */ /* Protocol (server) side */
su_network_changed_t *nua_nw_changed;
nua_registration_t *nua_registrations; /**< Active registrations */ nua_registration_t *nua_registrations; /**< Active registrations */
...@@ -253,8 +250,21 @@ struct nua_s { ...@@ -253,8 +250,21 @@ struct nua_s {
nta_agent_t *nua_nta; nta_agent_t *nua_nta;
su_timer_t *nua_timer; su_timer_t *nua_timer;
void *nua_sip_parser;
sip_time_t nua_shutdown;
/* Route */
sip_service_route_t *nua_service_route;
/* User-agent parameters */ /* User-agent parameters */
nua_global_preferences_t nua_prefs[1]; unsigned nua_media_enable:1;
unsigned :0;
#if HAVE_SMIME /* Start NRC Boston */
sm_object_t *sm;
#endif /* End NRC Boston */
nua_handle_t *nua_handles; nua_handle_t *nua_handles;
nua_handle_t **nua_handles_tail; nua_handle_t **nua_handles_tail;
......
...@@ -371,9 +371,6 @@ static int nua_subscribe_client_response(nua_client_request_t *cr, ...@@ -371,9 +371,6 @@ static int nua_subscribe_client_response(nua_client_request_t *cr,
else else
delta = 0; delta = 0;
if (delta > eu->eu_expires)
delta = eu->eu_expires;
if (win_messenger_enable && !nua_dialog_is_established(nh->nh_ds)) { if (win_messenger_enable && !nua_dialog_is_established(nh->nh_ds)) {
/* Notify from messanger does not match with dialog tag */ /* Notify from messanger does not match with dialog tag */
nh->nh_ds->ds_remote_tag = su_strdup(nh->nh_home, ""); nh->nh_ds->ds_remote_tag = su_strdup(nh->nh_home, "");
...@@ -382,23 +379,23 @@ static int nua_subscribe_client_response(nua_client_request_t *cr, ...@@ -382,23 +379,23 @@ static int nua_subscribe_client_response(nua_client_request_t *cr,
if (delta > 0) { if (delta > 0) {
nua_dialog_usage_set_refresh(du, delta); nua_dialog_usage_set_refresh(du, delta);
} }
else { else if (!eu->eu_notified) {
if (eu->eu_substate == nua_substate_terminated) { /* This is a fetch: subscription was really terminated
if (!eu->eu_notified) but we wait 32 seconds for NOTIFY. */
eu->eu_substate = nua_substate_embryonic; delta = 64 * NTA_SIP_T1 / 1000;
}
if (eu->eu_substate != nua_substate_terminated) { if (win_messenger_enable)
/* Wait 32 seconds for NOTIFY. */ delta = 4 * 60; /* Wait 4 minutes for NOTIFY from Messenger */
delta = 64 * NTA_SIP_T1 / 1000;
eu->eu_final_wait = 1;
if (!eu->eu_notified && win_messenger_enable) eu->eu_final_wait = 1;
delta = 4 * 60; /* Wait 4 minutes for NOTIFY from Messenger */
if (eu->eu_substate == nua_substate_terminated)
eu->eu_substate = nua_substate_embryonic;
nua_dialog_usage_set_refresh_range(du, delta, delta); nua_dialog_usage_set_refresh_range(du, delta, delta);
} }
else {
eu->eu_substate = nua_substate_terminated;
} }
substate = eu->eu_substate; substate = eu->eu_substate;
...@@ -653,6 +650,8 @@ int nua_notify_server_report(nua_server_request_t *sr, tagi_t const *tags) ...@@ -653,6 +650,8 @@ int nua_notify_server_report(nua_server_request_t *sr, tagi_t const *tags)
if (substate == nua_substate_active || substate == nua_substate_pending) { if (substate == nua_substate_active || substate == nua_substate_pending) {
if (subs && subs->ss_expires) if (subs && subs->ss_expires)
delta = strtoul(subs->ss_expires, NULL, 10); delta = strtoul(subs->ss_expires, NULL, 10);
else
delta = eu->eu_expires;
} }
else if (substate == nua_substate_embryonic) { else if (substate == nua_substate_embryonic) {
if (subs && subs->ss_reason) { if (subs && subs->ss_reason) {
...@@ -690,8 +689,7 @@ int nua_notify_server_report(nua_server_request_t *sr, tagi_t const *tags) ...@@ -690,8 +689,7 @@ int nua_notify_server_report(nua_server_request_t *sr, tagi_t const *tags)
nua_dialog_usage_set_refresh_range(du, retry, retry + 5); nua_dialog_usage_set_refresh_range(du, retry, retry + 5);
} }
else { else {
if (delta < SIP_TIME_MAX) nua_dialog_usage_set_refresh(du, delta);
nua_dialog_usage_set_refresh(du, delta);
} }
return retval; return retval;
......
...@@ -227,22 +227,21 @@ ...@@ -227,22 +227,21 @@
* - NUTAG_ALLOW_EVENTS(), SIPTAG_ALLOW_EVENTS(), and * - NUTAG_ALLOW_EVENTS(), SIPTAG_ALLOW_EVENTS(), and
* SIPTAG_ALLOW_EVENTS_STR() * SIPTAG_ALLOW_EVENTS_STR()
* - NUTAG_MAX_SUBSCRIPTIONS() * - NUTAG_MAX_SUBSCRIPTIONS()
* - NUTAG_SUBSTATE(), NUTAG_SUB_EXPIRES() * - NUTAG_SUBSTATE()
* @par Specifications * @par Specifications
* - @RFC3265 * - @RFC3265
* *
* @par SIP Event Subscriber * @par SIP Event Subscriber
* - nua_subscribe(), #nua_r_subscribe, #nua_i_notify, NUTAG_SUBSTATE(), * - nua_subscribe(), #nua_r_subscribe, #nua_i_notify, NUTAG_SUBSTATE(),
* SIPTAG_EVENT(), SIPTAG_EXPIRES() * SIPTAG_EVENT(), SIPTAG_EXPIRES(),
* - nua_unsubscribe(), #nua_r_unsubscribe() * - nua_unsubscribe(), #nua_r_unsubscribe()
* @par Specifications * @par Specifications
* - @RFC3265 * - @RFC3265
* *
* @par SIP Event Notifier * @par SIP Event Notifier
* - #nua_i_subscribe(), nua_notify(), #nua_r_notify, * - #nua_i_subscribe(), nua_notify(), #nua_r_notify,
* NUTAG_SUBSTATE(), NUTAG_SUB_EXPIRES(), SIPTAG_EVENT() * NUTAG_SUBSTATE(), SIPTAG_EVENT()
* Settings: * Settings:
* - NUTAG_SUB_EXPIRES()
* - NUTAG_ALLOW_EVENTS(), SIPTAG_ALLOW_EVENTS(), and * - NUTAG_ALLOW_EVENTS(), SIPTAG_ALLOW_EVENTS(), and
* SIPTAG_ALLOW_EVENTS_STR() * SIPTAG_ALLOW_EVENTS_STR()
* - NUTAG_ALLOW("SUBSCRIBE"), NUTAG_APPL_METHOD("SUBSCRIBE") * - NUTAG_ALLOW("SUBSCRIBE"), NUTAG_APPL_METHOD("SUBSCRIBE")
...@@ -268,8 +267,6 @@ ...@@ -268,8 +267,6 @@
* Settings: * Settings:
* - NUTAG_ALLOW(x), NUTAG_APPL_METHOD(x) * - NUTAG_ALLOW(x), NUTAG_APPL_METHOD(x)
* *
* @par Server Shutdown
* - nua_shutdown(), NUTAG_SHUTDOWN_EVENTS(), nua_destroy().
*/ */
/* @par S/MIME /* @par S/MIME
...@@ -770,14 +767,14 @@ tag_typedef_t nutag_answer_sent = BOOLTAG_TYPEDEF(answer_sent); ...@@ -770,14 +767,14 @@ tag_typedef_t nutag_answer_sent = BOOLTAG_TYPEDEF(answer_sent);
* *
* @par Used with * @par Used with
* - with nua_create(), nua_set_params(), nua_get_params(), * - with nua_create(), nua_set_params(), nua_get_params(),
* nua_handle(), nua_set_hparams(), nua_get_hparams(), and * nua_handle(), nua_set_hparams(), nua_get_hparams(), and
* nua_notifier() to change the default subscription state returned by * nua_notifier() to change the default subscription state returned by
* the internal event server * the intenal event server
* - with nua_notify() and nua_respond() to SUBSCRIBE to determine the * - with nua_notify() and nua_respond() to SUBSCRIBE to determine the
* subscription state (if application include @SubscriptionState * subscription state (if application include @SubscriptionState
* header in the tag list, the NUTAG_SUBSTATE() value is ignored) * header in the tag list, the NUTAG_SUBSTATE() value is ignored)
* - with #nua_r_subscribe, #nua_i_notify, #nua_i_subscribe, and #nua_r_notify * - with #nua_r_subscribe, #nua_i_notify, #nua_i_subscribe, and #nua_r_notify
* to indicate the current subscription state * to indicate the current subscription state
* *
* @par Parameter type * @par Parameter type
* int * int
...@@ -809,39 +806,6 @@ tag_typedef_t nutag_substate = INTTAG_TYPEDEF(substate); ...@@ -809,39 +806,6 @@ tag_typedef_t nutag_substate = INTTAG_TYPEDEF(substate);
*/ */
/**@def NUTAG_SUB_EXPIRES()
*
* Default expiration time of subscriptions.
*
* @par Used with
* - with nua_create(), nua_set_params(), nua_get_params(), nua_handle(),
* nua_set_hparams(), nua_get_hparams(), nua_respond(), nua_notify(), and
* nua_notifier() to change the default expiration time of subscriptions
*
* @par Parameter type
* unsigned int
*
* @par Values
* - default expiration time in seconds
*
* Note that the expires parameter in @SubscriptionState or @Expires header
* in the nua_response() to the SUBSCRIBE overrides the default subscription
* expiration specified by NUTAG_SUB_EXPIRES().
*
* @sa @RFC3265, NUTAG_REFER_EXPIRES(), @Expires, SIPTAG_EXPIRES(),
* SIPTAG_EXPIRES_STR(), @SubscriptionState, nua_respond(), nua_notifier(),
* #nua_r_subscribe, #nua_i_subscribe, #nua_r_refer, #nua_r_notify,
* #nua_i_notify.
*
* Corresponding tag taking reference parameter is NUTAG_SUB_EXPIRES_REF().
*/
tag_typedef_t nutag_sub_expires = UINTTAG_TYPEDEF(substate);
/**@def NUTAG_SUB_EXPIRES_REF(x)
* Reference tag for NUTAG_SUB_EXPIRES().
*/
/**@def NUTAG_NEWSUB() /**@def NUTAG_NEWSUB()
* *
* Send unsolicited NOTIFY request. * Send unsolicited NOTIFY request.
...@@ -1111,17 +1075,17 @@ tag_typedef_t nutag_update_refresh = BOOLTAG_TYPEDEF(update_refresh); ...@@ -1111,17 +1075,17 @@ tag_typedef_t nutag_update_refresh = BOOLTAG_TYPEDEF(update_refresh);
* REFER. * REFER.
* *
* @par Used with * @par Used with
* nua_handle(), nua_respond() \n * nua_set_params() \n
* nua_set_params() or nua_set_hparams() \n * nua_get_params() \n
* nua_get_params() or nua_get_hparams() * nua_set_hparams() \n
* nua_get_hparams() \n
* *
* @par Parameter type * @par Parameter type
* unsigned int * unsigned int
* *
* @par Values * @par Values
* - default interval in seconds * @c 0 disable \n
* * @c >0 interval in seconds
* @sa NUTAG_SUB_EXPIRES()
* *
* Corresponding tag taking reference parameter is NUTAG_REFER_EXPIRES_REF(). * Corresponding tag taking reference parameter is NUTAG_REFER_EXPIRES_REF().
*/ */
...@@ -1606,9 +1570,6 @@ extern msg_hclass_t sip_route_class[]; ...@@ -1606,9 +1570,6 @@ extern msg_hclass_t sip_route_class[];
* NUTAG_INITIAL_ROUTE_STR() tags, the route set is constructed from them * NUTAG_INITIAL_ROUTE_STR() tags, the route set is constructed from them
* all. * all.
* *
* The initial route is inserted into request message before the route
* entries set with SIPTAG_ROUTE() or SIPTAG_ROUTE_STR().
*
* @par Used with * @par Used with
* nua_set_params() \n * nua_set_params() \n
* nua_set_hparams() \n * nua_set_hparams() \n
...@@ -2775,39 +2736,6 @@ tag_typedef_t nutag_dialog = UINTTAG_TYPEDEF(dialog); ...@@ -2775,39 +2736,6 @@ tag_typedef_t nutag_dialog = UINTTAG_TYPEDEF(dialog);
* Reference tag for NUTAG_SIP_PARSER(). * Reference tag for NUTAG_SIP_PARSER().
*/ */
/**@def NUTAG_SHUTDOWN_EVENTS(x)
*
* Allow passing of normal events when stack is being shut down.
*
* By default, only #nua_r_shutdown events are passed to application after
* calling nua_shutdown(). If application is interested in nua events during
* shutdown, it should give NUTAG_SHUTDOWN_EVENTS(1) to nua_create() or
* nua_set_params() called before nua_shutdown().
*
* @par Used with
* nua_create(), nua_set_params().
*
* @par Parameter type
* int (boolean)
*
* @par Values
* @c 0 False \n
* @c !=0 True
*
* Corresponding tag taking reference parameter is NUTAG_SHUTDOWN_EVENTS_REF().
*
* @sa nua_shutdown(), nua_destroy().
*
* @NEW_1_12_9.
*/
tag_typedef_t nutag_shutdown_events = BOOLTAG_TYPEDEF(shutdown_events);
/**@def NUTAG_SHUTDOWN_EVENTS_REF(x)
* Reference tag for NUTAG_SHUTDOWN_EVENTS().
*/
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
tag_typedef_t nutag_soa_session = PTRTAG_TYPEDEF(soa_session); tag_typedef_t nutag_soa_session = PTRTAG_TYPEDEF(soa_session);
......
...@@ -497,16 +497,12 @@ SOFIAPUBFUN char const *nua_substate_name(enum nua_substate substate); ...@@ -497,16 +497,12 @@ SOFIAPUBFUN char const *nua_substate_name(enum nua_substate substate);
/** Convert string to enum nua_substate. @NEW_1_12_5. */ /** Convert string to enum nua_substate. @NEW_1_12_5. */
SOFIAPUBFUN enum nua_substate nua_substate_make(char const *sip_substate); SOFIAPUBFUN enum nua_substate nua_substate_make(char const *sip_substate);
#define NUTAG_SUB_EXPIRES(x) nutag_sub_expires, tag_uint_v(x)
SOFIAPUBVAR tag_typedef_t nutag_sub_expires;
#define NUTAG_SUB_EXPIRES_REF(x) nutag_sub_expires_ref, tag_uint_vr(&(x))
SOFIAPUBVAR tag_typedef_t nutag_sub_expires_ref;
#define NUTAG_NEWSUB(x) nutag_newsub, tag_bool_v(x) #define NUTAG_NEWSUB(x) nutag_newsub, tag_bool_v(x)
SOFIAPUBVAR tag_typedef_t nutag_newsub; SOFIAPUBVAR tag_typedef_t nutag_newsub;
#define NUTAG_NEWSUB_REF(x) nutag_newsub_ref, tag_bool_vr(&(x)) #define NUTAG_NEWSUB_REF(x) nutag_newsub_ref, tag_bool_vr(&(x))
SOFIAPUBVAR tag_typedef_t nutag_newsub_ref; SOFIAPUBVAR tag_typedef_t nutag_newsub_ref;
#define NUTAG_REFER_EXPIRES(x) nutag_refer_expires, tag_uint_v((x)) #define NUTAG_REFER_EXPIRES(x) nutag_refer_expires, tag_uint_v((x))
SOFIAPUBVAR tag_typedef_t nutag_refer_expires; SOFIAPUBVAR tag_typedef_t nutag_refer_expires;
#define NUTAG_REFER_EXPIRES_REF(x) nutag_refer_expires_ref, tag_uint_vr((&(x))) #define NUTAG_REFER_EXPIRES_REF(x) nutag_refer_expires_ref, tag_uint_vr((&(x)))
...@@ -573,13 +569,6 @@ SOFIAPUBVAR tag_typedef_t nutag_detect_network_updates; ...@@ -573,13 +569,6 @@ SOFIAPUBVAR tag_typedef_t nutag_detect_network_updates;
nutag_detect_network_updates_ref, tag_int_vr(&(x)) nutag_detect_network_updates_ref, tag_int_vr(&(x))
SOFIAPUBVAR tag_typedef_t nutag_detect_network_updates_ref; SOFIAPUBVAR tag_typedef_t nutag_detect_network_updates_ref;
#define NUTAG_SHUTDOWN_EVENTS(x) \
nutag_shutdown_events, tag_bool_v(x)
SOFIAPUBVAR tag_typedef_t nutag_shutdown_events;
#define NUTAG_SHUTDOWN_EVENTS_REF(x) \
nutag_shutdown_events_ref, tag_bool_vr(&(x))
SOFIAPUBVAR tag_typedef_t nutag_shutdown_events_ref;
/* Pass nua handle as tagged argument */ /* Pass nua handle as tagged argument */
#if SU_INLINE_TAG_CAST #if SU_INLINE_TAG_CAST
su_inline tag_value_t nutag_handle_v(nua_handle_t *v) { return (tag_value_t)v; } su_inline tag_value_t nutag_handle_v(nua_handle_t *v) { return (tag_value_t)v; }
......
...@@ -1433,9 +1433,6 @@ int test_bye_with_407(struct context *ctx) ...@@ -1433,9 +1433,6 @@ int test_bye_with_407(struct context *ctx)
a_call->sdp = "m=audio 5008 RTP/AVP 8"; a_call->sdp = "m=audio 5008 RTP/AVP 8";
c_call->sdp = "m=audio 5010 RTP/AVP 0 8"; c_call->sdp = "m=audio 5010 RTP/AVP 0 8";
if (!ctx->proxy_tests)
return 0;
/* BYE after receiving 401 /* BYE after receiving 401
A C A C
......
...@@ -178,10 +178,7 @@ struct context ...@@ -178,10 +178,7 @@ struct context
unsigned bit4:1, bit5:1, bit6:1, bit7:1; unsigned bit4:1, bit5:1, bit6:1, bit7:1;
unsigned :0; unsigned :0;
} flags; } flags;
/* Accross-run state information */
struct {
unsigned n;
} state;
} a, b, c; } a, b, c;
struct proxy *p; struct proxy *p;
......
...@@ -203,7 +203,6 @@ int test_nua_params(struct context *ctx) ...@@ -203,7 +203,6 @@ int test_nua_params(struct context *ctx)
NUTAG_REFER_EXPIRES(333), NUTAG_REFER_EXPIRES(333),
NUTAG_REFER_WITH_ID(0), NUTAG_REFER_WITH_ID(0),
NUTAG_SUBSTATE(nua_substate_pending), NUTAG_SUBSTATE(nua_substate_pending),
NUTAG_SUB_EXPIRES(3700),
NUTAG_KEEPALIVE(66), NUTAG_KEEPALIVE(66),
NUTAG_KEEPALIVE_STREAM(33), NUTAG_KEEPALIVE_STREAM(33),
...@@ -285,7 +284,6 @@ int test_nua_params(struct context *ctx) ...@@ -285,7 +284,6 @@ int test_nua_params(struct context *ctx)
int auth_cache = -1; int auth_cache = -1;
unsigned refer_expires = (unsigned)-1; unsigned refer_expires = (unsigned)-1;
int refer_with_id = -1; int refer_with_id = -1;
unsigned sub_expires = (unsigned)-1;
int substate = -1; int substate = -1;
sip_allow_t const *allow = NONE; sip_allow_t const *allow = NONE;
...@@ -354,7 +352,6 @@ int test_nua_params(struct context *ctx) ...@@ -354,7 +352,6 @@ int test_nua_params(struct context *ctx)
NUTAG_REFER_EXPIRES_REF(refer_expires), NUTAG_REFER_EXPIRES_REF(refer_expires),
NUTAG_REFER_WITH_ID_REF(refer_with_id), NUTAG_REFER_WITH_ID_REF(refer_with_id),
NUTAG_SUBSTATE_REF(substate), NUTAG_SUBSTATE_REF(substate),
NUTAG_SUB_EXPIRES_REF(sub_expires),
SIPTAG_SUPPORTED_REF(supported), SIPTAG_SUPPORTED_REF(supported),
SIPTAG_SUPPORTED_STR_REF(supported_str), SIPTAG_SUPPORTED_STR_REF(supported_str),
...@@ -385,7 +382,7 @@ int test_nua_params(struct context *ctx) ...@@ -385,7 +382,7 @@ int test_nua_params(struct context *ctx)
NUTAG_INSTANCE_REF(instance), NUTAG_INSTANCE_REF(instance),
TAG_END()); TAG_END());
TEST(n, 51); TEST(n, 50);
TEST_S(sip_header_as_string(tmphome, (void *)from), Alice); TEST_S(sip_header_as_string(tmphome, (void *)from), Alice);
TEST_S(from_str, Alice); TEST_S(from_str, Alice);
...@@ -419,7 +416,6 @@ int test_nua_params(struct context *ctx) ...@@ -419,7 +416,6 @@ int test_nua_params(struct context *ctx)
TEST(refer_expires, 333); TEST(refer_expires, 333);
TEST(refer_with_id, 0); TEST(refer_with_id, 0);
TEST(substate, nua_substate_pending); TEST(substate, nua_substate_pending);
TEST(sub_expires, 3700);
TEST_S(sip_header_as_string(tmphome, (void *)allow), "OPTIONS, INFO, ACK"); TEST_S(sip_header_as_string(tmphome, (void *)allow), "OPTIONS, INFO, ACK");
TEST_S(allow_str, "OPTIONS, INFO, ACK"); TEST_S(allow_str, "OPTIONS, INFO, ACK");
...@@ -496,7 +492,6 @@ int test_nua_params(struct context *ctx) ...@@ -496,7 +492,6 @@ int test_nua_params(struct context *ctx)
unsigned refer_expires = (unsigned)-1; unsigned refer_expires = (unsigned)-1;
int refer_with_id = -1; int refer_with_id = -1;
int substate = -1; int substate = -1;
unsigned sub_expires = (unsigned)-1;
sip_allow_t const *allow = NONE; sip_allow_t const *allow = NONE;
char const *allow_str = "NONE"; char const *allow_str = "NONE";
...@@ -557,7 +552,6 @@ int test_nua_params(struct context *ctx) ...@@ -557,7 +552,6 @@ int test_nua_params(struct context *ctx)
NUTAG_PATH_ENABLE_REF(path_enable), NUTAG_PATH_ENABLE_REF(path_enable),
NUTAG_AUTH_CACHE_REF(auth_cache), NUTAG_AUTH_CACHE_REF(auth_cache),
NUTAG_SUBSTATE_REF(substate), NUTAG_SUBSTATE_REF(substate),
NUTAG_SUB_EXPIRES_REF(sub_expires),
SIPTAG_SUPPORTED_REF(supported), SIPTAG_SUPPORTED_REF(supported),
SIPTAG_SUPPORTED_STR_REF(supported_str), SIPTAG_SUPPORTED_STR_REF(supported_str),
...@@ -613,7 +607,6 @@ int test_nua_params(struct context *ctx) ...@@ -613,7 +607,6 @@ int test_nua_params(struct context *ctx)
TEST(refer_expires, (unsigned)-1); TEST(refer_expires, (unsigned)-1);
TEST(refer_with_id, -1); TEST(refer_with_id, -1);
TEST(substate, -1); TEST(substate, -1);
TEST(sub_expires, -1);
TEST_P(allow, NONE); TEST_P(allow, NONE);
TEST_S(allow_str, "NONE"); TEST_S(allow_str, "NONE");
......
...@@ -182,12 +182,6 @@ void print_event(nua_event_t event, ...@@ -182,12 +182,6 @@ void print_event(nua_event_t event,
ep->name, (void *)nh, nua_event_name(event), phrase, ep->name, (void *)nh, nua_event_name(event), phrase,
nua_substate_name(t ? t->t_value : 0)); nua_substate_name(t ? t->t_value : 0));
} }
else if ((int)event >= nua_i_bye ||
event == nua_i_invite || event == nua_i_cancel ||
event == nua_i_ack) {
fprintf(stderr, "%s %s.nua(%p): event %s %03d %s\n", timestamp,
ep->name, (void *)nh, nua_event_name(event), status, phrase);
}
else if ((int)event >= 0) { else if ((int)event >= 0) {
fprintf(stderr, "%s %s.nua(%p): event %s %s\n", timestamp, fprintf(stderr, "%s %s.nua(%p): event %s %s\n", timestamp,
ep->name, (void *)nh, nua_event_name(event), phrase); ep->name, (void *)nh, nua_event_name(event), phrase);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论