add domains documentation and rename config option

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2005-09-26 23:14:59 +00:00
parent 9bbf4c3854
commit fdccf66d52
2 changed files with 26 additions and 9 deletions

View File

@@ -480,7 +480,7 @@ struct domain {
static AST_LIST_HEAD_STATIC(domain_list, domain); static AST_LIST_HEAD_STATIC(domain_list, domain);
int allow_external_invites; int allow_external_domains;
/* sip_history: Structure for saving transactions within a SIP dialog */ /* sip_history: Structure for saving transactions within a SIP dialog */
struct sip_history { struct sip_history {
@@ -6312,7 +6312,7 @@ static int get_destination(struct sip_pvt *p, struct sip_request *oreq)
domain_context[0] = '\0'; domain_context[0] = '\0';
if (!check_sip_domain(p->domain, domain_context, sizeof(domain_context))) { if (!check_sip_domain(p->domain, domain_context, sizeof(domain_context))) {
if (allow_external_invites && (req->method == SIP_INVITE || req->method == SIP_REFER)) { if (!allow_external_domains && (req->method == SIP_INVITE || req->method == SIP_REFER)) {
ast_log(LOG_DEBUG, "Got SIP %s to non-local domain '%s'; refusing request.\n", sip_methods[req->method].text, p->domain); ast_log(LOG_DEBUG, "Got SIP %s to non-local domain '%s'; refusing request.\n", sip_methods[req->method].text, p->domain);
return -2; return -2;
} }
@@ -7896,7 +7896,7 @@ static int sip_show_settings(int fd, int argc, char *argv[])
ast_cli(fd, " Allow unknown access: %s\n", global_allowguest ? "Yes" : "No"); ast_cli(fd, " Allow unknown access: %s\n", global_allowguest ? "Yes" : "No");
ast_cli(fd, " Promsic. redir: %s\n", ast_test_flag(&global_flags, SIP_PROMISCREDIR) ? "Yes" : "No"); ast_cli(fd, " Promsic. redir: %s\n", ast_test_flag(&global_flags, SIP_PROMISCREDIR) ? "Yes" : "No");
ast_cli(fd, " SIP domain support: %s\n", AST_LIST_EMPTY(&domain_list) ? "No" : "Yes"); ast_cli(fd, " SIP domain support: %s\n", AST_LIST_EMPTY(&domain_list) ? "No" : "Yes");
ast_cli(fd, " Call to non-local dom.: %s\n", allow_external_invites ? "Yes" : "No"); ast_cli(fd, " Call to non-local dom.: %s\n", allow_external_domains ? "Yes" : "No");
ast_cli(fd, " URI user is phone no: %s\n", ast_test_flag(&global_flags, SIP_USEREQPHONE) ? "Yes" : "No"); ast_cli(fd, " URI user is phone no: %s\n", ast_test_flag(&global_flags, SIP_USEREQPHONE) ? "Yes" : "No");
ast_cli(fd, " Our auth realm %s\n", global_realm); ast_cli(fd, " Our auth realm %s\n", global_realm);
ast_cli(fd, " Realm. auth: %s\n", authl ? "Yes": "No"); ast_cli(fd, " Realm. auth: %s\n", authl ? "Yes": "No");
@@ -11902,7 +11902,7 @@ static int reload_config(void)
default_language[0] = '\0'; default_language[0] = '\0';
default_fromdomain[0] = '\0'; default_fromdomain[0] = '\0';
default_qualify = 0; default_qualify = 0;
allow_external_invites = 1; /* Allow external invites */ allow_external_domains = 1; /* Allow external invites */
externhost[0] = '\0'; externhost[0] = '\0';
externexpire = 0; externexpire = 0;
externrefresh = 10; externrefresh = 10;
@@ -12089,8 +12089,8 @@ static int reload_config(void)
ast_parse_allow_disallow(&prefs, &global_capability, v->value, 1); ast_parse_allow_disallow(&prefs, &global_capability, v->value, 1);
} else if (!strcasecmp(v->name, "disallow")) { } else if (!strcasecmp(v->name, "disallow")) {
ast_parse_allow_disallow(&prefs, &global_capability, v->value, 0); ast_parse_allow_disallow(&prefs, &global_capability, v->value, 0);
} else if (!strcasecmp(v->name, "allowexternalinvites")) { } else if (!strcasecmp(v->name, "allowexternaldomains")) {
allow_external_invites = ast_true(v->value); allow_external_domains = ast_true(v->value);
} else if (!strcasecmp(v->name, "autodomain")) { } else if (!strcasecmp(v->name, "autodomain")) {
auto_sip_domains = ast_true(v->value); auto_sip_domains = ast_true(v->value);
} else if (!strcasecmp(v->name, "domain")) { } else if (!strcasecmp(v->name, "domain")) {
@@ -12135,9 +12135,9 @@ static int reload_config(void)
v = v->next; v = v->next;
} }
if (!allow_external_invites && AST_LIST_EMPTY(&domain_list)) { if (!allow_external_domains && AST_LIST_EMPTY(&domain_list)) {
ast_log(LOG_WARNING, "To disallow external INVITEs, you need to configure local SIP domains.\n"); ast_log(LOG_WARNING, "To disallow external domains, you need to configure local SIP domains.\n");
allow_external_invites = 1; allow_external_domains = 1;
} }
/* Build list of authentication to various SIP realms, i.e. service providers */ /* Build list of authentication to various SIP realms, i.e. service providers */

View File

@@ -190,6 +190,23 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; has expired based on its registration interval, used the stored ; has expired based on its registration interval, used the stored
; address information regardless. (yes|no) ; address information regardless. (yes|no)
; Incoming INVITE and REFER messages can be matched against a list of 'allowed'
; domains, each of which can direct the call to a specific context if desired.
; By default, all domains are accepted and sent to the default context or the
; context associated with the user/peer placing the call.
; Domains can be specified using:
; domain=<domain>[,<context>]
; Examples:
; domain=myasterisk.dom
; domain=customer.com,customer-context
;
; In addition, all the 'default' domains associated with a server should be
; added if incoming request filtering is desired.
; autodomain=yes
;
; To disallow requests for domains not serviced by this server:
; allowexternaldomains=no
[authentication] [authentication]
; Global credentials for outbound calls, i.e. when a proxy challenges your ; Global credentials for outbound calls, i.e. when a proxy challenges your
; Asterisk server for authentication. These credentials override ; Asterisk server for authentication. These credentials override