[asterisk-commits] tilghman: branch 1.8 r297733 - in /branches/1.8: ./ apps/app_followme.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 6 18:29:30 CST 2010


Author: tilghman
Date: Mon Dec  6 18:29:26 2010
New Revision: 297733

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=297733
Log:
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)
  ........
................

Modified:
    branches/1.8/   (props changed)
    branches/1.8/apps/app_followme.c

Propchange: branches/1.8/
------------------------------------------------------------------------------
Binary property 'branch-1.6.2-merged' - no diff available.

Modified: branches/1.8/apps/app_followme.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/apps/app_followme.c?view=diff&rev=297733&r1=297732&r2=297733
==============================================================================
--- branches/1.8/apps/app_followme.c (original)
+++ branches/1.8/apps/app_followme.c Mon Dec  6 18:29:26 2010
@@ -811,7 +811,6 @@
 			break;
 
 	while (nm) {
-
 		ast_debug(2, "Number %s timeout %ld\n", nm->number,nm->timeout);
 
 		number = ast_strdupa(nm->number);
@@ -823,6 +822,14 @@
 				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 @@
 
 			tmpuser = ast_calloc(1, sizeof(*tmpuser));
 			if (!tmpuser) {
-				ast_log(LOG_WARNING, "Out of memory!\n");
 				ast_free(findme_user_list);
 				return;
 			}




More information about the asterisk-commits mailing list