[asterisk-commits] oej: branch oej/pinequeue-trunk r363926 - in /team/oej/pinequeue-trunk: apps/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 26 02:20:27 CDT 2012


Author: oej
Date: Thu Apr 26 02:20:22 2012
New Revision: 363926

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=363926
Log:
Making sure that #2 and the rest in the queue also here prompts and music.

Adding docs
--Denna och nedanstående rader kommer inte med i loggmeddelandet--

M    apps/app_queue.c
M    configs/queues.conf.sample

Modified:
    team/oej/pinequeue-trunk/apps/app_queue.c
    team/oej/pinequeue-trunk/configs/queues.conf.sample

Modified: team/oej/pinequeue-trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinequeue-trunk/apps/app_queue.c?view=diff&rev=363926&r1=363925&r2=363926
==============================================================================
--- team/oej/pinequeue-trunk/apps/app_queue.c (original)
+++ team/oej/pinequeue-trunk/apps/app_queue.c Thu Apr 26 02:20:22 2012
@@ -54,7 +54,33 @@
  * by Matthew Enger <m.enger at xi.com.au>
  *
  * \ingroup applications
+ *
+ * Related information
+ * \ref queue_bg_prompts Background queue prompts
  */
+
+/*!
+ * \page queue_bg_prompts Background queue prompts
+ *
+ * The background queue prompts changes the way we entertain the channel with
+ * various prompts. The prompts are stored in a playlist and played by a generator
+ * which means that if an agent becomes available while we play a prompt, the prompt
+ * will be interrupted and the call will be answered. Without background prompts
+ * the available agent has to wait until the prompt is finished before the phone
+ * rings and the customer can be serviced.
+ *
+ * This is implemented as a channel datastore that maintains the playlist. A call
+ * to play_file() or say_<something> will just add prompts to the list.
+ *
+ * You need to make sure that the periodic announcements and the messages match
+ * timewise, otherwise they will all be queued up and played too late.
+ *
+ * A possible fix would be to mark position and wait time messages in the play
+ * queue so that when a new one is added, the old ones are removed.
+ *
+ */
+ 
+
 
 /*** MODULEINFO
 	<use type="module">res_monitor</use>
@@ -2722,30 +2748,6 @@
 }
 
 void destroy_streamfile_info(struct ast_queue_streamfile_info *playdata);
-/* Uncommented by Old Olle patch 
-static int play_file(struct ast_channel *chan, const char *filename)
-{
-	int res;
-
-	if (ast_strlen_zero(filename)) {
-		return 0;
-	}
-
-	if (!ast_fileexists(filename, NULL, ast_channel_language(chan))) {
-		return 0;
-	}
-
-	ast_stopstream(chan);
-
-	res = ast_streamfile(chan, filename, ast_channel_language(chan));
-	if (!res) {
-		res = ast_waitstream(chan, AST_DIGIT_ANY);
-	}
-
-	ast_stopstream(chan);
-
-	return res;
-} */
 
 /*!
  * \brief Check for valid exit from queue via goto
@@ -4273,6 +4275,10 @@
 			*reason = QUEUE_TIMEOUT;
 			break;
 		}
+
+		if (background_prompts) {
+			play_file(qe->chan, NULL, 0, qe->moh);
+		}
 		
 		/* Wait a second before checking again */
 		if ((res = ast_waitfordigit(qe->chan, RECHECK * 1000))) {
@@ -6614,19 +6620,22 @@
 		S_OR(args.url, ""),
 		S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, ""),
 		qe.opos);
-  /* Begin old Olle patch */
-	datastore = ast_datastore_alloc(ast_sound_ending(), NULL);
-
-	aqsi->qe = &qe;
-	aqsi->chan = chan;
-	aqsi->ringing = ringing;
-	aqsi->now_playing = 0;
-	strcpy(aqsi->moh, qe.moh);
-	AST_LIST_HEAD_INIT(&aqsi->flist);
-	datastore->data = aqsi;
+	if (background_prompts) {
+		/* Set up the channel datastore for the playlist of prompts
+		   that we're going to play in the background while the call
+		   is in the queue. 
+		 */
+		datastore = ast_datastore_alloc(ast_sound_ending(), NULL);
+		aqsi->qe = &qe;
+		aqsi->chan = chan;
+		aqsi->ringing = ringing;
+		aqsi->now_playing = 0;
+		strcpy(aqsi->moh, qe.moh);
+		AST_LIST_HEAD_INIT(&aqsi->flist);
+		datastore->data = aqsi;
 	
-	ast_channel_datastore_add(chan, datastore);
-  /* End old Olle patch */
+		ast_channel_datastore_add(chan, datastore);
+	}
 
 	copy_rules(&qe, args.rule);
 	qe.pr = AST_LIST_FIRST(&qe.qe_rules);

Modified: team/oej/pinequeue-trunk/configs/queues.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinequeue-trunk/configs/queues.conf.sample?view=diff&rev=363926&r1=363925&r2=363926
==============================================================================
--- team/oej/pinequeue-trunk/configs/queues.conf.sample (original)
+++ team/oej/pinequeue-trunk/configs/queues.conf.sample Thu Apr 26 02:20:22 2012
@@ -82,7 +82,12 @@
 ; which means that even if a queue member becomes available, the 
 ; prompt will be played fully. Enabling 'background_prompts' will
 ; make sure that prompts are interruptible. If a queue member becomes
-; available, the prompt will be interrupted.
+; available, the prompt will be interrupted immediately.
+;
+; Make sure that your prompts are shorter than the interval between
+; periodic announcements. Otherwise, there will be a queue to play
+; and it will sound awkward for the customer to here that you are now
+; number 4,3,2 and 1 in the queue at the same time...
 ;
 background_prompts=no
 ;




More information about the asterisk-commits mailing list