summaryrefslogtreecommitdiff
path: root/channels/sip
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2012-04-28 20:24:45 +0000
committerJoshua Colp <jcolp@digium.com>2012-04-28 20:24:45 +0000
commitae1502be33e92b1c7460264dfa40c362a6abd791 (patch)
treec77c954074147b64c5f550be04ed405329320c83 /channels/sip
parent19097a4b62860092f1dc70a42f07103c0586aed1 (diff)
Add support for lightweight NAT keepalive.
If enabled using the keepalive option in sip.conf a small packet will be sent at a regular interval to keep the NAT mapping open. This is lightweight as the remote side does not need to parse and handle a SIP message. (closes issue AST-783) Review: https://reviewboard.asterisk.org/r/1756/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sip')
-rw-r--r--channels/sip/include/sip.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/channels/sip/include/sip.h b/channels/sip/include/sip.h
index ba1610c7f..1b257cf95 100644
--- a/channels/sip/include/sip.h
+++ b/channels/sip/include/sip.h
@@ -212,6 +212,8 @@
#define DEFAULT_AUTOCREATEPEER AUTOPEERS_DISABLED /*!< Don't create peers automagically */
#define DEFAULT_MATCHEXTERNADDRLOCALLY FALSE /*!< Match extern IP locally default setting */
#define DEFAULT_QUALIFY FALSE /*!< Don't monitor devices */
+#define DEFAULT_KEEPALIVE 0 /*!< Don't send keep alive packets */
+#define DEFAULT_KEEPALIVE_INTERVAL 60 /*!< Send keep alive packets at 60 second intervals */
#define DEFAULT_CALLEVENTS FALSE /*!< Extra manager SIP call events */
#define DEFAULT_ALWAYSAUTHREJECT TRUE /*!< Don't reject authentication requests always */
#define DEFAULT_AUTH_OPTIONS FALSE
@@ -1319,6 +1321,8 @@ struct sip_peer {
int maxms; /*!< Qualification: Max ms we will accept for the host to be up, 0 to not monitor */
int qualifyfreq; /*!< Qualification: Qualification: How often to check for the host to be up */
struct timeval ps; /*!< Qualification: Time for sending SIP OPTION in sip_pke_peer() */
+ int keepalive; /*!< Keepalive: How often to send keep alive packet */
+ int keepalivesend; /*!< Keepalive: Scheduled item for sending keep alive packet */
struct ast_sockaddr defaddr; /*!< Default IP address, used until registration */
struct ast_ha *ha; /*!< Access control list */
struct ast_ha *contactha; /*!< Restrict what IPs are allowed in the Contact header (for registration) */