diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-10-02 00:58:31 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-10-02 00:58:31 +0000 |
commit | 6868babd229a635c5fd89c7b284025a92e0a3f9d (patch) | |
tree | 25a4ee6dff29d18acfdfbbc42485333db7aa5311 /apps/app_lookupblacklist.c | |
parent | b201da1a3eb1cae654cdd3fe89ef8f9e55dd0b83 (diff) |
Huge callerid rework (might break H.323, others)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3874 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_lookupblacklist.c')
-rwxr-xr-x | apps/app_lookupblacklist.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/apps/app_lookupblacklist.c b/apps/app_lookupblacklist.c index 69743e377..82a556b15 100755 --- a/apps/app_lookupblacklist.c +++ b/apps/app_lookupblacklist.c @@ -3,9 +3,9 @@ * * App to lookup the callerid number, and see if it is blacklisted * - * Copyright (C) 1999, Mark Spencer + * Copyright (C) 1999-2004, Digium, Inc. * - * Mark Spencer <markster@linux-support.net> + * Mark Spencer <markster@digium.com> * * This program is free software, distributed under the terms of * the GNU General Public License @@ -48,38 +48,30 @@ LOCAL_USER_DECL; static int lookupblacklist_exec (struct ast_channel *chan, void *data) { - char old_cid[144] = "", *num, *name; char blacklist[1]; - char shrunknum[64] = ""; struct localuser *u; int bl = 0; LOCAL_USER_ADD (u); - if (chan->callerid) + if (chan->cid.cid_num) { - strncpy (old_cid, chan->callerid, sizeof (old_cid) - 1); - ast_callerid_parse (old_cid, &name, &num); - if (num) - strncpy (shrunknum, num, sizeof (shrunknum) - 1); - else - num = shrunknum; - - ast_shrink_phone_number (shrunknum); - if (!ast_db_get ("blacklist", shrunknum, blacklist, sizeof (blacklist))) + if (!ast_db_get ("blacklist", chan->cid.cid_num, blacklist, sizeof (blacklist))) { if (option_verbose > 2) - ast_log(LOG_NOTICE, "Blacklisted number %s found\n",shrunknum); + ast_log(LOG_NOTICE, "Blacklisted number %s found\n",chan->cid.cid_num); bl = 1; } - else if (!ast_db_get ("blacklist", name, blacklist, sizeof (blacklist))) + } + if (chan->cid.cid_name) { + if (!ast_db_get ("blacklist", chan->cid.cid_name, blacklist, sizeof (blacklist))) { if (option_verbose > 2) - ast_log (LOG_NOTICE,"Blacklisted name \"%s\" found\n",name); + ast_log (LOG_NOTICE,"Blacklisted name \"%s\" found\n",chan->cid.cid_name); bl = 1; } } - if (bl && ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->callerid)) + if (bl && ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num)) chan->priority+=100; LOCAL_USER_REMOVE (u); return 0; |