summaryrefslogtreecommitdiff
path: root/pjsip/include/pjsua-lib/pjsua.h
diff options
context:
space:
mode:
Diffstat (limited to 'pjsip/include/pjsua-lib/pjsua.h')
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h71
1 files changed, 45 insertions, 26 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index ad261561..beb0762e 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -569,6 +569,39 @@ typedef enum pjsua_create_media_transport_flag
/**
+ * This enumeration specifies the contact rewrite method.
+ */
+typedef enum pjsua_contact_rewrite_method
+{
+ /**
+ * The Contact update will be done by sending unregistration
+ * to the currently registered Contact, while simultaneously sending new
+ * registration (with different Call-ID) for the updated Contact.
+ */
+ PJSUA_CONTACT_REWRITE_UNREGISTER = 1,
+
+ /**
+ * The Contact update will be done in a single, current
+ * registration session, by removing the current binding (by setting its
+ * Contact's expires parameter to zero) and adding a new Contact binding,
+ * all done in a single request.
+ */
+ PJSUA_CONTACT_REWRITE_NO_UNREG = 2,
+
+ /**
+ * The Contact update will be done when receiving any registration final
+ * response. If this flag is not specified, contact update will only be
+ * done upon receiving 2xx response. This flag MUST be used with
+ * PJSUA_CONTACT_REWRITE_UNREGISTER or PJSUA_CONTACT_REWRITE_NO_UNREG
+ * above to specify how the Contact update should be performed when
+ * receiving 2xx response.
+ */
+ PJSUA_CONTACT_REWRITE_ALWAYS_UPDATE = 4
+
+} pjsua_contact_rewrite_method;
+
+
+/**
* Call settings.
*/
typedef struct pjsua_call_setting
@@ -2540,25 +2573,18 @@ PJ_DECL(pj_status_t) pjsua_transport_close( pjsua_transport_id id,
/**
* This macro specifies the default value for \a contact_rewrite_method
- * field in pjsua_acc_config. I specifies how Contact update will be
+ * field in pjsua_acc_config. It specifies how Contact update will be
* done with the registration, if \a allow_contact_rewrite is enabled in
- * the account config.
- *
- * If set to 1, the Contact update will be done by sending unregistration
- * to the currently registered Contact, while simultaneously sending new
- * registration (with different Call-ID) for the updated Contact.
+ * the account config. See \a pjsua_contact_rewrite_method for the options.
*
- * If set to 2, the Contact update will be done in a single, current
- * registration session, by removing the current binding (by setting its
- * Contact's expires parameter to zero) and adding a new Contact binding,
- * all done in a single request.
+ * Value PJSUA_CONTACT_REWRITE_UNREGISTER(1) is the legacy behavior.
*
- * Value 1 is the legacy behavior.
- *
- * Default value: 2
+ * Default value: PJSUA_CONTACT_REWRITE_NO_UNREG(2) |
+ * PJSUA_CONTACT_REWRITE_ALWAYS_UPDATE(4)
*/
#ifndef PJSUA_CONTACT_REWRITE_METHOD
-# define PJSUA_CONTACT_REWRITE_METHOD 2
+# define PJSUA_CONTACT_REWRITE_METHOD (PJSUA_CONTACT_REWRITE_NO_UNREG | \
+ PJSUA_CONTACT_REWRITE_ALWAYS_UPDATE)
#endif
@@ -3010,20 +3036,13 @@ typedef struct pjsua_acc_config
/**
* Specify how Contact update will be done with the registration, if
- * \a allow_contact_rewrite is enabled.
- *
- * If set to 1, the Contact update will be done by sending unregistration
- * to the currently registered Contact, while simultaneously sending new
- * registration (with different Call-ID) for the updated Contact.
- *
- * If set to 2, the Contact update will be done in a single, current
- * registration session, by removing the current binding (by setting its
- * Contact's expires parameter to zero) and adding a new Contact binding,
- * all done in a single request.
+ * \a allow_contact_rewrite is enabled. The value is bitmask combination of
+ * \a pjsua_contact_rewrite_method. See also pjsua_contact_rewrite_method.
*
- * Value 1 is the legacy behavior.
+ * Value PJSUA_CONTACT_REWRITE_UNREGISTER(1) is the legacy behavior.
*
- * Default value: PJSUA_CONTACT_REWRITE_METHOD (2)
+ * Default value: PJSUA_CONTACT_REWRITE_METHOD
+ * (PJSUA_CONTACT_REWRITE_NO_UNREG | PJSUA_CONTACT_REWRITE_ALWAYS_UPDATE)
*/
int contact_rewrite_method;