[svn-commits] branch bweschke/findme_followme r31952 - /team/bweschke/findme_followme/apps/

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sat Jun 3 22:44:12 MST 2006


Author: bweschke
Date: Sun Jun  4 00:44:11 2006
New Revision: 31952

URL: http://svn.digium.com/view/asterisk?rev=31952&view=rev
Log:
 Don't "double hangup" on a timeout and some other code optimizations.


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=31952&r1=31951&r2=31952&view=diff
==============================================================================
--- team/bweschke/findme_followme/apps/app_followme.c (original)
+++ team/bweschke/findme_followme/apps/app_followme.c Sun Jun  4 00:44:11 2006
@@ -394,7 +394,7 @@
 		totalwait = nm->timeout * 1000;
 		while (!ctstatus) {
 			*to = 1000;
-			pos = 1;
+			pos = 1; 
 			livechannels = 0;
 			watchers[0] = caller;
 		
@@ -451,8 +451,8 @@
 							}
 						}
 					}
-					watchers[pos++] = tmpuser->ochan;
-					livechannels++;
+				watchers[pos++] = tmpuser->ochan;
+				livechannels++;
 				}
 			}
 
@@ -472,10 +472,9 @@
 				dg = 0;
 				while ((winner != watchers[dg]) && (dg < 256))
 					dg++;
-				AST_LIST_TRAVERSE(findme_user_list, tmpuser, entry) {
+				AST_LIST_TRAVERSE(findme_user_list, tmpuser, entry)
 					if (tmpuser->ochan == winner)
 						break;
-				}
 				f = ast_read(winner);
 				if (f) {
 					if (f->frametype == AST_FRAME_CONTROL) {
@@ -497,6 +496,8 @@
 							/* If call has been answered, then the eventual hangup is likely to be normal hangup */ 
 							winner->hangupcause = AST_CAUSE_NORMAL_CLEARING;
 							caller->hangupcause = AST_CAUSE_NORMAL_CLEARING;
+							if (option_verbose > 2)
+								ast_verbose( VERBOSE_PREFIX_3 "Starting playback of %s\n", callfromname);
 							if (dg > 0) {
 								if (!ast_streamfile(winner, callfromname, winner->language)) {
 									ast_sched_runq(winner->sched);
@@ -631,7 +632,9 @@
 					}
 				}					
 				
-			} 
+			} else
+				if (option_debug)
+					ast_log(LOG_DEBUG, "timed out waiting for action\n");
 		}
 		
 	}
@@ -766,7 +769,7 @@
 		
 					
 		AST_LIST_TRAVERSE_SAFE_BEGIN(findme_user_list, fmuser, entry) {
-			if (fmuser->ochan != winner)
+			if (winner && fmuser->ochan != winner)
 				clear_caller(fmuser);
 			AST_LIST_REMOVE_CURRENT(findme_user_list, entry);
 			free(fmuser);



More information about the svn-commits mailing list