summaryrefslogtreecommitdiff
path: root/pjsip/include
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-10-31 13:28:08 +0000
committerBenny Prijono <bennylp@teluu.com>2007-10-31 13:28:08 +0000
commitef040a9c543b0b51e0f278ebb7a3e6a9588e9b83 (patch)
tree48055d526b8ebf7c313fe7a61cfd101c528e5e8c /pjsip/include
parentc25863d18e273d92f61550f7dccf9a54c81dd9b8 (diff)
Ticket #407: keep-alive for UDP transports in PJSUA-LIB
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1536 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include')
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h38
-rw-r--r--pjsip/include/pjsua-lib/pjsua_internal.h6
2 files changed, 41 insertions, 3 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index 579d722f..fb324f4d 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -1768,7 +1768,7 @@ PJ_DECL(pj_status_t) pjsua_transport_close( pjsua_transport_id id,
* Default registration interval.
*/
#ifndef PJSUA_REG_INTERVAL
-# define PJSUA_REG_INTERVAL 55
+# define PJSUA_REG_INTERVAL 300
#endif
@@ -1897,7 +1897,7 @@ typedef struct pjsua_acc_config
/**
* Optional interval for registration, in seconds. If the value is zero,
- * default interval will be used (PJSUA_REG_INTERVAL, 55 seconds).
+ * default interval will be used (PJSUA_REG_INTERVAL, 300 seconds).
*/
unsigned reg_timeout;
@@ -1947,6 +1947,28 @@ typedef struct pjsua_acc_config
*/
pj_bool_t auto_update_nat;
+ /**
+ * Set the interval for periodic keep-alive transmission for this account.
+ * If this value is zero, keep-alive will be disabled for this account.
+ * The keep-alive transmission will be sent to the registrar's address,
+ * after successful registration.
+ *
+ * Even if this setting is enabled, keep-alive transmission is only done
+ * when STUN is enabled in the global #pjsua_config, and the transport
+ * used for registration is UDP. For TCP and TLS transports, keep-alive
+ * is done by the transport themselves.
+ *
+ * Default: 15 (seconds)
+ */
+ unsigned ka_interval;
+
+ /**
+ * Specify the data to be transmitted as keep-alive packets.
+ *
+ * Default: CR-LF
+ */
+ pj_str_t ka_data;
+
} pjsua_acc_config;
@@ -1966,6 +1988,18 @@ PJ_DECL(void) pjsua_acc_config_default(pjsua_acc_config *cfg);
/**
+ * Duplicate account config.
+ *
+ * @param pool Pool to be used for duplicating the config.
+ * @param dst Destination configuration.
+ * @param src Source configuration.
+ */
+PJ_DECL(void) pjsua_acc_config_dup(pj_pool_t *pool,
+ pjsua_acc_config *dst,
+ const pjsua_acc_config *src);
+
+
+/**
* Account info. Application can query account info by calling
* #pjsua_acc_get_info().
*
diff --git a/pjsip/include/pjsua-lib/pjsua_internal.h b/pjsip/include/pjsua-lib/pjsua_internal.h
index 004c1ca1..87d30b99 100644
--- a/pjsip/include/pjsua-lib/pjsua_internal.h
+++ b/pjsip/include/pjsua-lib/pjsua_internal.h
@@ -86,10 +86,14 @@ typedef struct pjsua_acc
int srv_port; /**< Port number of reg server. */
pjsip_regc *regc; /**< Client registration session. */
- pj_timer_entry reg_timer; /**< Registration timer. */
pj_status_t reg_last_err; /**< Last registration error. */
int reg_last_code; /**< Last status last register. */
+ pj_timer_entry ka_timer; /**< Keep-alive timer for UDP. */
+ pjsip_transport *ka_transport; /**< Transport for keep-alive. */
+ pj_sockaddr ka_target; /**< Destination address for K-A */
+ unsigned ka_target_len; /**< Length of ka_target. */
+
pjsip_route_hdr route_set; /**< Complete route set inc. outbnd.*/
unsigned cred_cnt; /**< Number of credentials. */