aboutsummaryrefslogtreecommitdiffstats
path: root/channels/sip
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-16 10:00:58 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-16 10:00:58 +0000
commitc7a055522da15bc29d0a78df1233983b5b372740 (patch)
tree66a1b6bdd4c7e628f65780c4ed2a03d1734dfef7 /channels/sip
parent884f6d5489131ce6ae1ee0ed6a909092cfaca49f (diff)
Add ability to configure the Max-Forwards header in the dialplan, as well as in
sip.conf configuration for the channel and for devices. The Max-Forwards header is used to prevent loops in a SIP network. Each intermediary, like SIP proxys and SBCs, decrement this counter and detects when it reaches zero, at which point the SIP request is nicely killed in a SIP-friendly way. Review: https://reviewboard.asterisk.org/r/778/ Thanks to dvossel for the review and good advice. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276951 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/sip')
-rw-r--r--channels/sip/include/sip.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/channels/sip/include/sip.h b/channels/sip/include/sip.h
index 2644536cd..706a8e796 100644
--- a/channels/sip/include/sip.h
+++ b/channels/sip/include/sip.h
@@ -57,7 +57,7 @@
#define DEFAULT_MAX_EXPIRY 3600
#define DEFAULT_MWI_EXPIRY 3600
#define DEFAULT_REGISTRATION_TIMEOUT 20
-#define DEFAULT_MAX_FORWARDS "70"
+#define DEFAULT_MAX_FORWARDS 70
/* guard limit must be larger than guard secs */
/* guard min must be < 1000, and should be >= 250 */
@@ -703,6 +703,7 @@ struct sip_settings {
struct ast_ha *contact_ha; /*! \brief Global list of addresses dynamic peers are not allowed to use */
format_t capability; /*!< Supported codecs */
int tcp_enabled;
+ int default_max_forwards; /*!< Default max forwards (SIP Anti-loop) */
};
/*! \brief The SIP socket definition */
@@ -953,6 +954,7 @@ struct sip_pvt {
AST_STRING_FIELD(dialstring); /*!< The dialstring used to call this SIP endpoint */
);
char via[128]; /*!< Via: header */
+ int maxforwards; /*!< SIP Loop prevention */
struct sip_socket socket; /*!< The socket used for this dialog */
unsigned int ocseq; /*!< Current outgoing seqno */
unsigned int icseq; /*!< Current incoming seqno */
@@ -1194,6 +1196,7 @@ struct sip_peer {
int call_limit; /*!< Limit of concurrent calls */
int t38_maxdatagram; /*!< T.38 FaxMaxDatagram override */
int busy_level; /*!< Level of active channels where we signal busy */
+ int maxforwards; /*!< SIP Loop prevention */
enum transfermodes allowtransfer; /*! SIP Refer restriction scheme */
struct ast_codec_pref prefs; /*!< codec prefs */
int lastmsgssent;