summaryrefslogtreecommitdiff
path: root/channels/sip
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2011-12-23 20:19:33 +0000
committerJonathan Rose <jrose@digium.com>2011-12-23 20:19:33 +0000
commit03596bcb47858095a6f42492768808def97dcbbe (patch)
tree7fc0b2a7d4dc7718773a029dd5423949b069e471 /channels/sip
parent35a64c2e6162644970ffc26e533ec41b2891f4db (diff)
chan_sip autocreatepeer=persist option for auto-created peers to survive reload
This patch moves destruction of sip peers to immediately after the general section of sip.conf is read so that autocreatepeer setting can be read before deletion of peers. If autocreatepeer=persist at reload, then peers created by the autocreatepeer setting will be skipped when purging the current SIP peer list. (closes ASTERISK-16508) Reported by: Kirill Katsnelson Patches: 017797-kkm-persist-autopeers-1.8.patch uploaded by Kirill Katsnelson (license 5845) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349097 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sip')
-rw-r--r--channels/sip/include/sip.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/channels/sip/include/sip.h b/channels/sip/include/sip.h
index 0c3661d91..84f3af93b 100644
--- a/channels/sip/include/sip.h
+++ b/channels/sip/include/sip.h
@@ -207,7 +207,7 @@
#define DEFAULT_NOTIFYRINGING TRUE /*!< Notify devicestate system on ringing state */
#define DEFAULT_NOTIFYCID DISABLED /*!< Include CID with ringing notifications */
#define DEFAULT_PEDANTIC TRUE /*!< Follow SIP standards for dialog matching */
-#define DEFAULT_AUTOCREATEPEER FALSE /*!< Don't create peers automagically */
+#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_CALLEVENTS FALSE /*!< Extra manager SIP call events */
@@ -556,6 +556,14 @@ enum sip_transport {
SIP_TRANSPORT_TLS = 1 << 2, /*!< TCP/TLS - reliable and secure transport for signalling */
};
+/*! \brief Automatic peer registration behavior
+*/
+enum autocreatepeer_mode {
+ AUTOPEERS_DISABLED = 0, /*!< Automatic peer creation disabled */
+ AUTOPEERS_VOLATILE, /*!< Automatic peers dropped on sip reload (pre-1.8 behavior) */
+ AUTOPEERS_PERSIST /*!< Automatic peers survive sip configuration reload */
+};
+
/*! \brief States whether a SIP message can create a dialog in Asterisk. */
enum can_create_dialog {
CAN_NOT_CREATE_DIALOG,
@@ -709,7 +717,7 @@ struct sip_settings {
int rtautoclear; /*!< Realtime ?? */
int directrtpsetup; /*!< Enable support for Direct RTP setup (no re-invites) */
int pedanticsipchecking; /*!< Extra checking ? Default off */
- int autocreatepeer; /*!< Auto creation of peers at registration? Default off. */
+ enum autocreatepeer_mode autocreatepeer; /*!< Auto creation of peers at registration? Default off. */
int srvlookup; /*!< SRV Lookup on or off. Default is on */
int allowguest; /*!< allow unauthenticated peers to connect? */
int alwaysauthreject; /*!< Send 401 Unauthorized for all failing requests */