-Fri Oct 26 14:14:41 CDT 2012
+Fri Nov 2 13:36:06 CDT 2012
status == 500 || status == 503 ||
status == 600 || status == 603) &&
sip->sip_retry_after &&
+ NH_PGET(nh, retry_after_enable) &&
sip->sip_retry_after->af_delta < 3200) {
su_timer_t *timer;
char phrase[18]; /* Retry After XXXX\0 */
NHP_SET(nhp, callee_caps, 0);
NHP_SET(nhp, service_route_enable, 1);
NHP_SET(nhp, path_enable, 1);
+ NHP_SET(nhp, retry_after_enable, 1);
NHP_SET(nhp, refer_expires, 300);
NHP_SET(nhp, refer_with_id, 1);
* NUTAG_ONLY183_100REL() \n
* NUTAG_OUTBOUND() \n
* NUTAG_PATH_ENABLE() \n
+ * NUTAG_RETRY_AFTER_ENABLE() \n
* NUTAG_PROXY() (aka NTATAG_DEFAULT_PROXY()) \n
* NUTAG_REFER_EXPIRES() \n
* NUTAG_REFER_WITH_ID() \n
* NUTAG_ONLY183_100REL() \n
* NUTAG_OUTBOUND() \n
* NUTAG_PATH_ENABLE() \n
+ * NUTAG_RETRY_AFTER_ENABLE() \n
* NUTAG_PROXY() (aka NTATAG_DEFAULT_PROXY()) \n
* NUTAG_REFER_EXPIRES() \n
* NUTAG_REFER_WITH_ID() \n
else if (tag == nutag_path_enable) {
NHP_SET(nhp, path_enable, value != 0);
}
+ /* NUTAG_RETRY_AFTER_ENABLE(retry_after_enable) */
+ else if (tag == nutag_retry_after_enable) {
+ NHP_SET(nhp, retry_after_enable, value != 0);
+ }
/* NUTAG_AUTH_CACHE(auth_cache) */
else if (tag == nutag_auth_cache) {
if (value >= 0 && value < (tag_value_t)_nua_auth_cache_invalid)
* NUTAG_ONLY183_100REL() \n
* NUTAG_OUTBOUND() \n
* NUTAG_PATH_ENABLE() \n
+ * NUTAG_RETRY_AFTER_ENABLE() \n
* NUTAG_REFER_EXPIRES() \n
* NUTAG_REFER_WITH_ID() \n
* NUTAG_REFRESH_WITHOUT_SDP() \n
TIF(NUTAG_MEDIA_FEATURES, media_features),
TIF(NUTAG_SERVICE_ROUTE_ENABLE, service_route_enable),
TIF(NUTAG_PATH_ENABLE, path_enable),
+ TIF(NUTAG_RETRY_AFTER_ENABLE, retry_after_enable),
TIF(NUTAG_AUTH_CACHE, auth_cache),
TIF(NUTAG_REFER_EXPIRES, refer_expires),
TIF(NUTAG_REFER_WITH_ID, refer_with_id),
unsigned nhp_refer_with_id:1;
unsigned nhp_timer_autorequire:1;
+
+ /** Enable Retry-After */
+ unsigned nhp_retry_after_enable:1;
+
unsigned:0;
/* Default lifetime for implicit subscriptions created by REFER */
unsigned nhb_initial_route:1;
unsigned nhb_proxy:1;
unsigned nhb_timer_autorequire:1;
+ unsigned nhb_retry_after_enable:1;
unsigned :0;
} set_bits;
unsigned set_unsigned[2];
* - NUTAG_M_USERNAME()
* - NUTAG_OUTBOUND()
* - NUTAG_PATH_ENABLE()
+ * - NUTAG_RETRY_AFTER_ENABLE()
* - NUTAG_SERVICE_ROUTE_ENABLE()
* Specifications:
* - @RFC3261 section 10, @RFC3327, @RFC3608, @RFC3680, @RFC3840,
* Reference tag for NUTAG_PATH_ENABLE().
*/
+/**@def NUTAG_RETRY_AFTER_ENABLE(x)
+ *
+ * If true, support RFC 3261 Retry-After
+ *
+ * @par Used with
+ * - nua_create(), nua_set_params(), nua_get_params()
+ * - nua_handle(), nua_set_hparams(), nua_get_hparams()
+ * - nua_register()
+ *
+ * @par Parameter type
+ * int (boolean: nonzero is true, zero is false)
+ *
+ * @par Values
+ * - 0 (false) - Do not honor Retry-After
+ * - 1 (true) - honor Retry-After
+ *
+ */
+tag_typedef_t nutag_retry_after_enable = BOOLTAG_TYPEDEF(retry_after_enable);
+
+/**@def NUTAG_RETRY_AFTER_ENABLE_REF(x)
+ * Reference tag for NUTAG_RETRY_AFTER_ENABLE().
+ */
+
/**@def NUTAG_SERVICE_ROUTE_ENABLE(x)
#define NUTAG_PATH_ENABLE_REF(x) nutag_path_enable_ref, tag_bool_vr(&(x))
SOFIAPUBVAR tag_typedef_t nutag_path_enable_ref;
+#define NUTAG_RETRY_AFTER_ENABLE(x) nutag_retry_after_enable, tag_bool_v(x)
+SOFIAPUBVAR tag_typedef_t nutag_retry_after_enable;
+#define NUTAG_RETRY_AFTER_ENABLE_REF(x) nutag_retry_after_enable_ref, tag_bool_vr(&(x))
+SOFIAPUBVAR tag_typedef_t nutag_retry_after_enable_ref;
+
#define NUTAG_SERVICE_ROUTE_ENABLE(x) nutag_service_route_enable, tag_bool_v(x)
SOFIAPUBVAR tag_typedef_t nutag_service_route_enable;
#define NUTAG_SERVICE_ROUTE_ENABLE_REF(x) \
profile, /* Additional data to pass to callback */
TAG_IF( ! sofia_test_pflag(profile, PFLAG_TLS) || ! profile->tls_only, NUTAG_URL(profile->bindurl)),
NTATAG_USER_VIA(1),
+ NUTAG_RETRY_AFTER_ENABLE(0),
TAG_IF(!strchr(profile->sipip, ':'),
SOATAG_AF(SOA_AF_IP4_ONLY)),
TAG_IF(strchr(profile->sipip, ':'),