mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 03:08:45 +00:00
make non matching IP addresses go to invalid extension if default context exists
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@836 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -961,9 +961,15 @@ int setup_incoming_call(call_details_t cd)
|
|||||||
} else {
|
} else {
|
||||||
if (user->host) {
|
if (user->host) {
|
||||||
if (strcasecmp(cd.sourceIp, inet_ntoa(user->addr.sin_addr))){
|
if (strcasecmp(cd.sourceIp, inet_ntoa(user->addr.sin_addr))){
|
||||||
|
|
||||||
|
if(!strlen(default_context)) {
|
||||||
ast_log(LOG_ERROR, "Call from user '%s' rejected due to non-matching IP address of '%s'\n", user->name, cd.sourceIp);
|
ast_log(LOG_ERROR, "Call from user '%s' rejected due to non-matching IP address of '%s'\n", user->name, cd.sourceIp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
strncpy(p->context, default_context, sizeof(p->context)-1);
|
||||||
|
sprintf(p->exten,"i");
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (user->incominglimit > 0) {
|
if (user->incominglimit > 0) {
|
||||||
if (user->inUse >= user->incominglimit) {
|
if (user->inUse >= user->incominglimit) {
|
||||||
@@ -994,6 +1000,8 @@ int setup_incoming_call(call_details_t cd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* I know this is horrid, don't kill me saddam */
|
||||||
|
exit:
|
||||||
/* allocate a channel and tell asterisk about it */
|
/* allocate a channel and tell asterisk about it */
|
||||||
c = oh323_new(p, AST_STATE_RINGING, cd.call_token);
|
c = oh323_new(p, AST_STATE_RINGING, cd.call_token);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user