aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-12 00:54:13 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-12 00:54:13 +0000
commit7a132852270c9ac739e1002183268baa139e0a2c (patch)
tree6c00c9efc08d59971d46af4c9f9906166b8f9663 /channels
parentaf8b2c777dd8352dc7d347abb130e5ccef842c17 (diff)
Merged revisions 58779 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r58779 | file | 2007-03-11 20:51:16 -0400 (Sun, 11 Mar 2007) | 2 lines Add matchexterniplocally setting which only substitutes your externip/externhost setting if it matches the localnet setting. I know of at least two people who need opposite settings, so I made it an option! (issue #8821 reported by kokoskarokoska) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@58780 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index efc1142cc..52030e7b3 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -578,6 +578,8 @@ static int global_autoframing; /*!< Turn autoframing on or off. */
static enum transfermodes global_allowtransfer; /*!< SIP Refer restriction scheme */
static struct sip_proxy global_outboundproxy; /*!< Outbound proxy */
+static int global_matchexterniplocally; /*!< Match externip/externhost setting against localnet setting */
+
/*! \brief Codecs that we support by default: */
static int global_capability = AST_FORMAT_ULAW | AST_FORMAT_ALAW | AST_FORMAT_GSM | AST_FORMAT_H263;
@@ -1935,7 +1937,7 @@ static enum sip_result ast_sip_ouraddrfor(struct in_addr *them, struct in_addr *
if (localaddr && externip.sin_addr.s_addr &&
(ast_apply_ha(localaddr, &theirs)) &&
- (!ast_apply_ha(localaddr, &ours))) {
+ (!global_matchexterniplocally || !ast_apply_ha(localaddr, &ours))) {
if (externexpire && time(NULL) >= externexpire) {
struct ast_hostent ahp;
struct hostent *hp;
@@ -16936,6 +16938,8 @@ static int reload_config(enum channelreloadreason reason)
global_callevents = FALSE;
global_t1min = DEFAULT_T1MIN;
+ global_matchexterniplocally = FALSE;
+
/* Copy the default jb config over global_jbconf */
memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
@@ -17187,6 +17191,8 @@ static int reload_config(enum channelreloadreason reason)
default_maxcallbitrate = atoi(v->value);
if (default_maxcallbitrate < 0)
default_maxcallbitrate = DEFAULT_MAX_CALL_BITRATE;
+ } else if (!strcasecmp(v->name, "matchexterniplocally")) {
+ global_matchexterniplocally = ast_true(v->value);
}
}