diff options
author | Kinsey Moore <kmoore@digium.com> | 2013-09-30 15:57:11 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2013-09-30 15:57:11 +0000 |
commit | b44ce141e5e418ff9e32fa628c35b451f74bf398 (patch) | |
tree | a6a318e688da7f3c0cbd7552b5161ceee9bd7314 /channels/chan_sip.c | |
parent | a1d56da32a98d1c5001dde9fc710b38e10781eb2 (diff) |
chan_sip: Allow Asterisk to retry after 403 on register
This adds a global option in chan_sip to allow it to continue
attempting registration if a 403 is received, clearing the cached nonce
and treating it as a non-fatal response. Normally, this would cause
registration attempts to that endpoint to stop.
This also adds a similar per-outbound-registration option to chan_pjsip
which allows the retry interval to be altered for 403 responses to
REGISTER requests.
(closes issue ASTERISK-17138)
Review: https://reviewboard.asterisk.org/r/2874/
Reported by: Rudi
........
Merged revisions 400137 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 400140 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 400141 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 4a45a9614..9cbfd715d 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -819,6 +819,7 @@ static int global_rtpholdtimeout; /*!< Time out call if no RTP during hold */ static int global_rtpkeepalive; /*!< Send RTP keepalives */ static int global_reg_timeout; /*!< Global time between attempts for outbound registrations */ static int global_regattempts_max; /*!< Registration attempts before giving up */ +static int global_reg_retry_403; /*!< Treat 403 responses to registrations as 401 responses */ static int global_shrinkcallerid; /*!< enable or disable shrinking of caller id */ static int global_callcounter; /*!< Enable call counters for all devices. This is currently enabled by setting the peer * call-limit to INT_MAX. When we remove the call-limit from the code, we can make it @@ -21143,6 +21144,7 @@ static char *sip_show_settings(struct ast_cli_entry *e, int cmd, struct ast_cli_ ast_cli(a->fd, " Sub. max duration: %d secs\n", max_subexpiry); ast_cli(a->fd, " Outbound reg. timeout: %d secs\n", global_reg_timeout); ast_cli(a->fd, " Outbound reg. attempts: %d\n", global_regattempts_max); + ast_cli(a->fd, " Outbound reg. retry 403:%d\n", global_reg_retry_403); ast_cli(a->fd, " Notify ringing state: %s\n", AST_CLI_YESNO(sip_cfg.notifyringing)); if (sip_cfg.notifyringing) { ast_cli(a->fd, " Include CID: %s%s\n", @@ -31373,6 +31375,7 @@ static int reload_config(enum channelreloadreason reason) sip_cfg.compactheaders = DEFAULT_COMPACTHEADERS; global_reg_timeout = DEFAULT_REGISTRATION_TIMEOUT; global_regattempts_max = 0; + global_reg_retry_403 = 0; sip_cfg.pedanticsipchecking = DEFAULT_PEDANTIC; sip_cfg.autocreatepeer = DEFAULT_AUTOCREATEPEER; global_autoframing = 0; @@ -31761,6 +31764,8 @@ static int reload_config(enum channelreloadreason reason) } } else if (!strcasecmp(v->name, "registerattempts")) { global_regattempts_max = atoi(v->value); + } else if (!strcasecmp(v->name, "register_retry_403")) { + global_reg_retry_403 = ast_true(v->value); } else if (!strcasecmp(v->name, "bindaddr") || !strcasecmp(v->name, "udpbindaddr")) { if (ast_parse_arg(v->value, PARSE_ADDR, &bindaddr)) { ast_log(LOG_WARNING, "Invalid address: %s\n", v->value); |