summaryrefslogtreecommitdiff
path: root/pjsip/include
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2014-11-04 08:00:15 +0000
committerNanang Izzuddin <nanang@teluu.com>2014-11-04 08:00:15 +0000
commit58ecec36e6e30a9f9066381e1a8e1751bfd94671 (patch)
tree953900613ae387dec82743df8fb3ba0e169bd4a1 /pjsip/include
parent5d027102466dca0528f6ac0da87a23517f6a3f07 (diff)
Close #1802: Configurable randomized value range for auto re-registration interval.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4957 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include')
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h22
-rw-r--r--pjsip/include/pjsua2/account.hpp29
2 files changed, 44 insertions, 7 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index 4d5fa69a..31c5378b 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -3292,8 +3292,9 @@ typedef struct pjsua_acc_config
* disable auto re-registration. Note that if the registration retry
* occurs because of transport failure, the first retry will be done
* after \a reg_first_retry_interval seconds instead. Also note that
- * the interval will be randomized slightly by approximately +/- ten
- * seconds to avoid all clients re-registering at the same time.
+ * the interval will be randomized slightly by some seconds (specified
+ * in \a reg_retry_random_interval) to avoid all clients re-registering
+ * at the same time.
*
* See also \a reg_first_retry_interval setting.
*
@@ -3304,13 +3305,28 @@ typedef struct pjsua_acc_config
/**
* This specifies the interval for the first registration retry. The
* registration retry is explained in \a reg_retry_interval. Note that
- * the value here will also be randomized by +/- ten seconds.
+ * the value here will also be randomized by some seconds (specified
+ * in \a reg_retry_random_interval) to avoid all clients re-registering
+ * at the same time.
*
* Default: 0
*/
unsigned reg_first_retry_interval;
/**
+ * This specifies maximum randomized value to be added/substracted
+ * to/from the registration retry interval specified in \a
+ * reg_retry_interval and \a reg_first_retry_interval, in second.
+ * This is useful to avoid all clients re-registering at the same time.
+ * For example, if the registration retry interval is set to 100 seconds
+ * and this is set to 10 seconds, the actual registration retry interval
+ * will be in the range of 90 to 110 seconds.
+ *
+ * Default: 10
+ */
+ unsigned reg_retry_random_interval;
+
+ /**
* Specify whether calls of the configured account should be dropped
* after registration failure and an attempt of re-registration has
* also failed.
diff --git a/pjsip/include/pjsua2/account.hpp b/pjsip/include/pjsua2/account.hpp
index 106ad9d7..acb78165 100644
--- a/pjsip/include/pjsua2/account.hpp
+++ b/pjsip/include/pjsua2/account.hpp
@@ -81,10 +81,12 @@ struct AccountRegConfig : public PersistentObject
* disable auto re-registration. Note that if the registration retry
* occurs because of transport failure, the first retry will be done
* after \a firstRetryIntervalSec seconds instead. Also note that
- * the interval will be randomized slightly by approximately +/- ten
- * seconds to avoid all clients re-registering at the same time.
+ * the interval will be randomized slightly by some seconds (specified
+ * in \a reg_retry_random_interval) to avoid all clients re-registering
+ * at the same time.
*
- * See also \a firstRetryIntervalSec setting.
+ * See also \a firstRetryIntervalSec and \a randomRetryIntervalSec
+ * settings.
*
* Default: PJSUA_REG_RETRY_INTERVAL
*/
@@ -93,13 +95,32 @@ struct AccountRegConfig : public PersistentObject
/**
* This specifies the interval for the first registration retry. The
* registration retry is explained in \a retryIntervalSec. Note that
- * the value here will also be randomized by +/- ten seconds.
+ * the value here will also be randomized by some seconds (specified
+ * in \a reg_retry_random_interval) to avoid all clients re-registering
+ * at the same time.
+ *
+ * See also \a retryIntervalSec and \a randomRetryIntervalSec settings.
*
* Default: 0
*/
unsigned firstRetryIntervalSec;
/**
+ * This specifies maximum randomized value to be added/substracted
+ * to/from the registration retry interval specified in \a
+ * reg_retry_interval and \a reg_first_retry_interval, in second.
+ * This is useful to avoid all clients re-registering at the same time.
+ * For example, if the registration retry interval is set to 100 seconds
+ * and this is set to 10 seconds, the actual registration retry interval
+ * will be in the range of 90 to 110 seconds.
+ *
+ * See also \a retryIntervalSec and \a firstRetryIntervalSec settings.
+ *
+ * Default: 10
+ */
+ unsigned randomRetryIntervalSec;
+
+ /**
* Specify the number of seconds to refresh the client registration
* before the registration expires.
*