IP based user authentcation

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jeremy McNamara
2003-03-31 19:26:15 +00:00
parent 3ebbb69e65
commit 33d20ff5ea
2 changed files with 6 additions and 0 deletions

View File

@@ -1,4 +1,6 @@
Build
-- Add IP based authentication using 'host'in type=user's
0.1.0
-- Intergration into the mainline Asterisk codebase
-- Remove reduandant debug info

View File

@@ -957,6 +957,10 @@ int setup_incoming_call(call_details_t cd)
strncpy(p->context, default_context, sizeof(p->context)-1);
ast_log(LOG_DEBUG, "Sending %s to context [%s]\n", cd.call_source_aliases, p->context);
} else {
if (strcasecmp(cd.sourceIp, inet_ntoa(user->addr.sin_addr))){
ast_log(LOG_ERROR, "Call from user '%s' rejected due to non-matching IP address: '%s'\n", user->name, cd.sourceIp);
return 0;
}
if (user->incominglimit > 0) {
if (user->inUse >= user->incominglimit) {
ast_log(LOG_ERROR, "Call from user '%s' rejected due to usage limit of %d\n", user->name, user->incominglimit);