[Asterisk-cvs] asterisk/channels chan_oss.c,1.40,1.41

markster at lists.digium.com markster at lists.digium.com
Fri Jan 21 15:24:26 CST 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv25528/channels

Modified Files:
	chan_oss.c 
Log Message:
Add optional one way playback (bug #3397)


Index: chan_oss.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_oss.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- chan_oss.c	21 Jan 2005 07:06:24 -0000	1.40
+++ chan_oss.c	21 Jan 2005 21:27:17 -0000	1.41
@@ -70,6 +70,7 @@
 static int usecnt;
 static int silencesuppression = 0;
 static int silencethreshold = 1000;
+static int playbackonly = 0;
 
 
 AST_MUTEX_DEFINE_STATIC(usecnt_lock);
@@ -565,9 +566,11 @@
 		return 0;
 	/* Stop any currently playing sound */
 	cursound = -1;
-	if (!full_duplex) {
+	if (!full_duplex && !playbackonly) {
 		/* If we're half duplex, we have to switch to read mode
-		   to honor immediate needs if necessary */
+		   to honor immediate needs if necessary.  But if we are in play
+		   back only mode, then we don't switch because the console
+		   is only being used one way -- just to playback something. */
 		res = soundcard_setinput(1);
 		if (res < 0) {
 			ast_log(LOG_WARNING, "Unable to set device to input mode\n");
@@ -1038,6 +1041,8 @@
 				strncpy(language, v->value, sizeof(language)-1);
 			else if (!strcasecmp(v->name, "extension"))
 				strncpy(exten, v->value, sizeof(exten)-1);
+			else if (!strcasecmp(v->name, "playbackonly"))
+				playbackonly = ast_true(v->value);
 			v=v->next;
 		}
 		ast_destroy(cfg);




More information about the svn-commits mailing list