diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-12-07 00:21:50 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-12-07 00:21:50 +0000 |
commit | 7d93d5e0c7a8f89dc0e0748fc225f48d81b4ac55 (patch) | |
tree | 0180335a4403e1a7dd955fc2831478b1fc0aa5cc /apps | |
parent | 1f9409dcdab35c50f8352b98f96fa5fc869f0663 (diff) |
Merged revisions 297689 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r297689 | tilghman | 2010-12-06 18:07:37 -0600 (Mon, 06 Dec 2010) | 8 lines
Don't create a Local channel if the target extension does not exist.
(closes issue #18126)
Reported by: junky
Patches:
followme.diff uploaded by junky (license 177)
(partially restructured by me to avoid a possible memory leak)
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@297713 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_followme.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/app_followme.c b/apps/app_followme.c index e79b6cf08..1f599809f 100644 --- a/apps/app_followme.c +++ b/apps/app_followme.c @@ -806,7 +806,6 @@ static void findmeexec(struct fm_args *tpargs) break; while (nm) { - ast_debug(2, "Number %s timeout %ld\n", nm->number,nm->timeout); number = ast_strdupa(nm->number); @@ -818,6 +817,14 @@ static void findmeexec(struct fm_args *tpargs) rest++; } + /* We check if that context exists, before creating the ast_channel struct needed */ + if (!ast_exists_extension(caller, tpargs->context, number, 1, caller->cid.cid_num)) { + /* XXX Should probably restructure to simply skip this item, instead of returning. XXX */ + ast_log(LOG_ERROR, "Extension '%s@%s' doesn't exist\n", number, tpargs->context); + free(findme_user_list); + return; + } + if (!strcmp(tpargs->context, "")) snprintf(dialarg, sizeof(dialarg), "%s", number); else @@ -825,7 +832,6 @@ static void findmeexec(struct fm_args *tpargs) tmpuser = ast_calloc(1, sizeof(*tmpuser)); if (!tmpuser) { - ast_log(LOG_WARNING, "Out of memory!\n"); ast_free(findme_user_list); return; } |