[asterisk-commits] bweschke: branch 1.4 r87514 - /branches/1.4/apps/app_followme.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 30 09:31:45 CDT 2007


Author: bweschke
Date: Tue Oct 30 09:31:45 2007
New Revision: 87514

URL: http://svn.digium.com/view/asterisk?view=rev&rev=87514
Log:
 Fix issue where the recorded name wasn't getting removed correctly. 
 (closes issue #11115) 
 Reported by: davevg
 Patches:
    followme-v3.diff

Modified:
    branches/1.4/apps/app_followme.c

Modified: branches/1.4/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_followme.c?view=diff&rev=87514&r1=87513&r2=87514
==============================================================================
--- branches/1.4/apps/app_followme.c (original)
+++ branches/1.4/apps/app_followme.c Tue Oct 30 09:31:45 2007
@@ -78,6 +78,7 @@
 struct number {
 	char number[512];	/*!< Phone Number(s) and/or Extension(s) */
 	long timeout;		/*!< Dial Timeout, if used. */
+	char language[MAX_LANGUAGE]; /*!< The language to be used on this dial, if used. */
 	int order;		/*!< The order to dial in */
 	AST_LIST_ENTRY(number) entry; /*!< Next Number record */
 };
@@ -255,7 +256,7 @@
 }
 
 /*! \brief Add a new number */
-static struct number *create_followme_number(char *number, int timeout, int numorder)
+static struct number *create_followme_number(char *number, char *language, int timeout, int numorder)
 {
 	struct number *cur;
 	char *tmp;
@@ -268,6 +269,7 @@
 	if ((tmp = strchr(number, ','))) 
 		*tmp = '\0';
 	ast_copy_string(cur->number, number, sizeof(cur->number));
+	ast_copy_string(cur->language, language, sizeof(cur->language));
 	cur->order = numorder;
 	if (option_debug)
 		ast_log(LOG_DEBUG, "Created a number, %s, order of , %d, with a timeout of %ld.\n", cur->number, cur->order, cur->timeout);
@@ -916,6 +918,7 @@
 	struct ast_module_user *u;
 	char *argstr;
 	char namerecloc[255];
+	char *fname = NULL;
 	int duration = 0;
 	struct ast_channel *caller;
 	struct ast_channel *outbound;
@@ -1011,10 +1014,6 @@
 			free(nm);
 		}
 		AST_LIST_TRAVERSE_SAFE_END
-	
-		if (!ast_strlen_zero(namerecloc))
-			unlink(namerecloc);	
-
 		if (targs.status != 100) {
 			ast_moh_stop(chan);
 			if (ast_test_flag(&targs.followmeflags, FOLLOWMEFLAG_UNREACHABLEMSG)) 
@@ -1053,6 +1052,12 @@
 		}
 	}
 	outrun:
+
+	if (!ast_strlen_zero(namerecloc)){
+		fname = alloca(strlen(namerecloc) + 5);
+		sprintf(fname, "%s.sln", namerecloc);
+		unlink(fname);
+	}
 	
 	ast_module_user_remove(u);
 




More information about the asterisk-commits mailing list