summaryrefslogtreecommitdiff
path: root/apps/app_followme.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2010-12-07 00:31:20 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2010-12-07 00:31:20 +0000
commit997816819bb66dcab31660b850781be72b984333 (patch)
treed0b2a55fe192f4b2a7b3a6f7e732cef63bb46d25 /apps/app_followme.c
parent537d23546033e52c7e4fdeb70411c3ac8b1947a9 (diff)
Merged revisions 297733 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r297733 | tilghman | 2010-12-06 18:29:26 -0600 (Mon, 06 Dec 2010) | 22 lines Merged revisions 297713 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r297713 | tilghman | 2010-12-06 18:21:50 -0600 (Mon, 06 Dec 2010) | 15 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@297734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_followme.c')
-rw-r--r--apps/app_followme.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/app_followme.c b/apps/app_followme.c
index b17d5252b..a71a683d3 100644
--- a/apps/app_followme.c
+++ b/apps/app_followme.c
@@ -811,7 +811,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);
@@ -823,6 +822,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, S_COR(caller->caller.id.number.valid, caller->caller.id.number.str, NULL))) {
+ /* 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
@@ -830,7 +837,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;
}