[asterisk-commits] branch bweschke/findme_followme r15515 - /team/bweschke/findme_followme/apps/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Mar 28 06:31:16 MST 2006


Author: bweschke
Date: Tue Mar 28 07:31:15 2006
New Revision: 15515

URL: http://svn.digium.com/view/asterisk?rev=15515&view=rev
Log:
 Fix issue to exit properly when name cannot be recorded and cleanup compiler warnings


Modified:
    team/bweschke/findme_followme/apps/app_followme.c

Modified: team/bweschke/findme_followme/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/findme_followme/apps/app_followme.c?rev=15515&r1=15514&r2=15515&view=diff
==============================================================================
--- team/bweschke/findme_followme/apps/app_followme.c (original)
+++ team/bweschke/findme_followme/apps/app_followme.c Tue Mar 28 07:31:15 2006
@@ -239,7 +239,7 @@
 			*tmp = '\0';
 		}
 		ast_copy_string(cur->number, number, sizeof(cur->number));
-		ast_log(LOG_DEBUG, "Created a number, %s, with a timeout of %d.\n", cur->number, cur->timeout);
+		ast_log(LOG_DEBUG, "Created a number, %s, with a timeout of %ld.\n", cur->number, cur->timeout);
 
 	}
 
@@ -394,10 +394,8 @@
 		int pos;
 		struct ast_channel *winner;
 		struct ast_frame *f;
-		char *rest, *number;
 		int ctstatus;
 		int dg;
-		struct findme_user *fmuser = NULL;
 		struct findme_user *tmpuser = NULL;
 		int *to = malloc(sizeof(int));
 		int livechannels = 0;
@@ -484,7 +482,7 @@
 				tmpto -= *to;
 				totalwait -= tmpto;
 				if (totalwait <= 0) {
-					ast_log(LOG_NOTICE, "We've hit our timeout for this step. Drop everyone and move on to the next one. %d\n", totalwait);
+					ast_log(LOG_NOTICE, "We've hit our timeout for this step. Drop everyone and move on to the next one. %ld\n", totalwait);
 					clear_calling_tree(headuser,1);
 					return 0;
 				}
@@ -589,22 +587,22 @@
 								}
 								if (!strcmp(tmpuser->yn, nextindp)) {
 									ast_log(LOG_NOTICE, "Next in dial plan step requested.\n");
-									status = 1;
+									*status = 1;
 									return 0;
 								}	
 								if (!strcmp(tmpuser->yn, nextinfmfm)) {
 									ast_log(LOG_NOTICE, "Next in find me/follow me step requested.\n");
-									status = 2;
+									*status = 2;
 									return 0;
 								}	
 								if (!strcmp(tmpuser->yn, blindxferexten)) {
 									ast_log(LOG_NOTICE, "Blind Transfer requested.\n");
-									status = 3;
+									*status = 3;
 									return 0;
 								}	
 								if (!strcmp(tmpuser->yn, atxferexten)) {
 									ast_log(LOG_NOTICE, "Attended Transfer requested.\n");
-									status = 4;
+									*status = 4;
 									return 0;
 								}	
 
@@ -639,14 +637,13 @@
 		else
 		{
 			ast_log(LOG_NOTICE, "couldn't reach at this number.\n");
-								
 		}
 		
 		/* --- WAIT FOR WINNER NUMBER END! -----------*/
-
-}
-
-static void *findmethread(void *args)
+		return NULL;
+}
+
+static void findmethread(void *args)
 {
 				struct thread_args *tpargs;
 				struct number *nm;
@@ -654,9 +651,7 @@
 				struct ast_channel *caller;
 				struct ast_channel *winner = NULL;
 				char dialarg[512];
-				int ynidx = 0, passed = 0, attempts = 0;
-				char yn[5];
-				int d = 0,dg;
+				int dg;
 				char *rest, *number;
 				struct findme_user *tmpuser = NULL;
 			        struct findme_user *fmuser = NULL;
@@ -689,7 +684,7 @@
 				while (nm)
 				{
 				
-				ast_log(LOG_DEBUG, "sleeping now inside the thread. Number %s timeout %d\n",nm->number,nm->timeout);
+				ast_log(LOG_DEBUG, "sleeping now inside the thread. Number %s timeout %ld\n",nm->number,nm->timeout);
 				time(&start_time);
 
 				number = ast_strdupa(nm->number);
@@ -803,9 +798,6 @@
 	struct ast_channel *caller;
 	struct ast_channel *outbound;
 	
-	pthread_t finderthread;
-	pthread_attr_t tattr;
-
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(followmeid);
 	);
@@ -848,19 +840,19 @@
 					
 				snprintf(namerecloc,sizeof(namerecloc),"%s/followme.%s",ast_config_AST_SPOOL_DIR,chan->uniqueid);
 				duration = 5;
-				ast_play_and_record(chan, "vm-rec-name", namerecloc, 5, "sln", &duration, 128, 0, NULL);
-				if (!ast_streamfile(chan, "pls-hold-while-try", chan->language)) {
-				} else
-				goto outrun;
+				if (ast_play_and_record(chan, "vm-rec-name", namerecloc, 5, "sln", &duration, 128, 0, NULL) < 0)
+					goto outrun;
+				if (ast_streamfile(chan, "pls-hold-while-try", chan->language))
+					goto outrun;
 				if (ast_waitstream(chan, "") < 0)
-				goto outrun;
+					goto outrun;
 				nm = f->numbers;
 				if (!strcmp(f->moh, ""))
 					ast_moh_start(chan, NULL);
 				else
 					ast_moh_start(chan, f->moh);
 				while (nm) {
-					 ast_log(LOG_DEBUG, "Number %s, timeout %d\n", nm->number, nm->timeout);
+					 ast_log(LOG_DEBUG, "Number %s, timeout %ld\n", nm->number, nm->timeout);
 					 nm = nm->next;
 				}
 



More information about the asterisk-commits mailing list