diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-09-26 23:14:59 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-09-26 23:14:59 +0000 |
commit | fdccf66d52b7937871ce40ad57b4d45b266777f5 (patch) | |
tree | ad90412dd4b556ae88e9393de46eb1d67c4e4ab6 | |
parent | 9bbf4c3854e1ffbedd9368f10c63b657130b7dde (diff) |
add domains documentation and rename config option
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rwxr-xr-x | channels/chan_sip.c | 18 | ||||
-rwxr-xr-x | configs/sip.conf.sample | 17 |
2 files changed, 26 insertions, 9 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 7c57d37ac..3751f4b3f 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -480,7 +480,7 @@ struct 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 */ struct sip_history { @@ -6312,7 +6312,7 @@ static int get_destination(struct sip_pvt *p, struct sip_request *oreq) domain_context[0] = '\0'; 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); 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, " 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, " 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, " Our auth realm %s\n", global_realm); ast_cli(fd, " Realm. auth: %s\n", authl ? "Yes": "No"); @@ -11902,7 +11902,7 @@ static int reload_config(void) default_language[0] = '\0'; default_fromdomain[0] = '\0'; default_qualify = 0; - allow_external_invites = 1; /* Allow external invites */ + allow_external_domains = 1; /* Allow external invites */ externhost[0] = '\0'; externexpire = 0; externrefresh = 10; @@ -12089,8 +12089,8 @@ static int reload_config(void) ast_parse_allow_disallow(&prefs, &global_capability, v->value, 1); } else if (!strcasecmp(v->name, "disallow")) { ast_parse_allow_disallow(&prefs, &global_capability, v->value, 0); - } else if (!strcasecmp(v->name, "allowexternalinvites")) { - allow_external_invites = ast_true(v->value); + } else if (!strcasecmp(v->name, "allowexternaldomains")) { + allow_external_domains = ast_true(v->value); } else if (!strcasecmp(v->name, "autodomain")) { auto_sip_domains = ast_true(v->value); } else if (!strcasecmp(v->name, "domain")) { @@ -12135,9 +12135,9 @@ static int reload_config(void) v = v->next; } - if (!allow_external_invites && AST_LIST_EMPTY(&domain_list)) { - ast_log(LOG_WARNING, "To disallow external INVITEs, you need to configure local SIP domains.\n"); - allow_external_invites = 1; + if (!allow_external_domains && AST_LIST_EMPTY(&domain_list)) { + ast_log(LOG_WARNING, "To disallow external domains, you need to configure local SIP domains.\n"); + allow_external_domains = 1; } /* Build list of authentication to various SIP realms, i.e. service providers */ diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample index ceff29bd3..4fa561177 100755 --- a/configs/sip.conf.sample +++ b/configs/sip.conf.sample @@ -190,6 +190,23 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls ; has expired based on its registration interval, used the stored ; 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] ; Global credentials for outbound calls, i.e. when a proxy challenges your ; Asterisk server for authentication. These credentials override |