[asterisk-commits] jpeeler: branch jpeeler/bug13173 r155506 - /team/jpeeler/bug13173/apps/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Nov 7 19:54:55 CST 2008


Author: jpeeler
Date: Fri Nov  7 19:54:55 2008
New Revision: 155506

URL: http://svn.digium.com/view/asterisk?view=rev&rev=155506
Log:
Channame no longer needed, removed. Turns out there were only two announcements (entering and leaving) that are played to the conference, so this code is feature complete after all.

Modified:
    team/jpeeler/bug13173/apps/app_meetme.c

Modified: team/jpeeler/bug13173/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/bug13173/apps/app_meetme.c?view=diff&rev=155506&r1=155505&r2=155506
==============================================================================
--- team/jpeeler/bug13173/apps/app_meetme.c (original)
+++ team/jpeeler/bug13173/apps/app_meetme.c Fri Nov  7 19:54:55 2008
@@ -326,7 +326,6 @@
 	AST_LIST_ENTRY(announce_listitem) entry;
 	char namerecloc[PATH_MAX];				/*!< Name Recorded file Location */
 	char language[MAX_LANGUAGE];
-	char channame[AST_CHANNEL_NAME];
 	struct ast_channel *confchan;
 	int confusers;
 	enum announcetypes announcetype;
@@ -1419,36 +1418,6 @@
 	}
 }
 
-/* jpeeler: I think using this function warrants use of astobj2 */
-/*
-static int announcement_played(struct ast_conference *conf, struct ast_channel *chan)
-{
-	struct announce_listitem *item;
-	int ret = 0;
-	ast_mutex_lock(&conf->announcelistlock);
-	if (AST_LIST_EMPTY(&conf->announcelist)) {
-		ast_mutex_unlock(&conf->announcelistlock);
-	ast_log(LOG_NOTICE, "jpeeler: list was empty\n");
-		return 0;
-	}
-
-	AST_LIST_TRAVERSE_SAFE_BEGIN(&conf->announcelist, item, entry) {
-	ast_log(LOG_NOTICE, "jpeeler: checking for match in %s\n", item->channame);
-		if (!strcmp(item->channame, chan->name)) {
-	ast_log(LOG_NOTICE, "jpeeler: announcement not played yet\n");
-			ret = 1;
-			break;
-		}
-		item = AST_LIST_NEXT(item, entry);
-	}
-	AST_LIST_TRAVERSE_SAFE_END;
-
-	ast_log(LOG_NOTICE, "jpeeler: announcement not found\n");
-	ast_mutex_unlock(&conf->announcelistlock);
-	return ret;
-}
-*/
-
 static void *announce_thread(void *data)
 {
 	struct announce_listitem *next, *current;
@@ -1471,7 +1440,7 @@
 		}
 
 		while ((current = next) && !conf->announcethread_stop) {
-			ast_log(LOG_DEBUG, "About to play %s on behalf of %s\n", current->namerecloc, current->channame);
+			ast_log(LOG_DEBUG, "About to play %s\n", current->namerecloc);
 			if (ast_fileexists(current->namerecloc, NULL, NULL)) {
 				if ((current->confchan) && (current->confusers > 1) && !ast_check_hangup(current->confchan)) {
 					if (!ast_streamfile(current->confchan, current->namerecloc, current->language))
@@ -1493,7 +1462,6 @@
 			ast_mutex_lock(&conf->announcelistlock);
 			AST_LIST_REMOVE_HEAD(&conf->announcelist, entry);
 			ao2_ref(current, -1);
-			//ast_free(current);
 			ast_mutex_unlock(&conf->announcelistlock);
 		}
 	}
@@ -1503,7 +1471,6 @@
 		ast_log(LOG_DEBUG, "jpeeler: deleting %s\n", current->namerecloc);
 		ast_filedelete(current->namerecloc, NULL);
 		ao2_ref(current, -1);
-		//ast_free(current);
 	}
 	return NULL;
 }
@@ -1601,10 +1568,6 @@
 
 	ast_mutex_lock(&conf->announcethreadlock);
 	if ((conf->announcethread == AST_PTHREADT_NULL) && !(confflags & CONFFLAG_QUIET) && ((confflags & CONFFLAG_INTROUSER) || (confflags & CONFFLAG_INTROUSERNOREVIEW))) {
-		//pthread_attr_init(&conf->attr);
-		//pthread_attr_setdetachstate(&conf->attr, PTHREAD_CREATE_DETACHED);
-		//ast_pthread_create_background(&conf->announcethread, &conf->attr, announce_thread, conf);
-		//pthread_attr_destroy(&conf->attr);
 		ast_mutex_init(&conf->announcelistlock);
 		AST_LIST_HEAD_INIT_NOLOCK(&conf->announcelist);
 		ast_pthread_create_background(&conf->announcethread, NULL, announce_thread, conf);
@@ -1815,15 +1778,12 @@
 	ztc.chan = 0;	
 	ztc.confno = conf->zapconf;
 
-	//ast_mutex_lock(&conf->playlock);
-
 	if (!(confflags & CONFFLAG_QUIET) && ((confflags & CONFFLAG_INTROUSER) || (confflags & CONFFLAG_INTROUSERNOREVIEW)) && conf->users > 1) {
 		struct announce_listitem *item;
 		if (!(item = ao2_alloc(sizeof(*item), NULL)))
 			return -1;
 		ast_copy_string(item->namerecloc, user->namerecloc, sizeof(item->namerecloc));
 		ast_copy_string(item->language, chan->language, sizeof(item->language));
-		ast_copy_string(item->channame, chan->name, sizeof(item->channame));
 		item->confchan = conf->chan;
 		item->confusers = conf->users;
 		item->announcetype = CONF_HASJOIN;
@@ -1851,7 +1811,6 @@
 	if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
 		ast_log(LOG_WARNING, "Error setting conference\n");
 		close(fd);
-		//ast_mutex_unlock(&conf->playlock);
 		goto outrun;
 	}
 	ast_log(LOG_DEBUG, "Placed channel %s in %s conf %d\n", chan->name, dahdi_chan_name, conf->zapconf);
@@ -1872,8 +1831,6 @@
 			if (!(confflags & CONFFLAG_WAITMARKED) || ((confflags & CONFFLAG_MARKEDUSER) && (conf->markedusers >= 1)))
 				conf_play(chan, conf, ENTER);
 	}
-
-	//ast_mutex_unlock(&conf->playlock);
 
 	conf_flush(fd, chan);
 
@@ -2431,7 +2388,6 @@
 			return -1;
 		ast_copy_string(item->namerecloc, user->namerecloc, sizeof(item->namerecloc));
 		ast_copy_string(item->language, chan->language, sizeof(item->language));
-		ast_copy_string(item->channame, chan->name, sizeof(item->channame));
 		item->confchan = conf->chan;
 		item->confusers = conf->users;
 		item->announcetype = CONF_HASLEFT;




More information about the asterisk-commits mailing list