[Asterisk-cvs] asterisk/apps app_agi.c,1.32,1.33 app_disa.c,1.9,1.10 app_echo.c,1.7,1.8 app_festival.c,1.15,1.16 app_intercom.c,1.14,1.15 app_meetme.c,1.20,1.21 app_milliwatt.c,1.5,1.6 app_mp3.c,1.12,1.13 app_qcall.c,1.8,1.9 app_record.c,1.14,1.15 app_voicemail.c,1.68,1.69 app_zapbarge.c,1.1,1.2 app_zapscan.c,1.5,1.6

markster at lists.digium.com markster at lists.digium.com
Sat Mar 27 01:52:45 CST 2004


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

Modified Files:
	app_agi.c app_disa.c app_echo.c app_festival.c app_intercom.c 
	app_meetme.c app_milliwatt.c app_mp3.c app_qcall.c 
	app_record.c app_voicemail.c app_zapbarge.c app_zapscan.c 
Log Message:
Make read/write mode have a lock parameter and use it properly.


Index: app_agi.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_agi.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- app_agi.c	23 Mar 2004 12:50:15 -0000	1.32
+++ app_agi.c	27 Mar 2004 06:50:12 -0000	1.33
@@ -521,7 +521,7 @@
 
         if (silence > 0) {
         	rfmt = chan->readformat;
-                res = ast_set_read_format(chan, AST_FORMAT_SLINEAR);
+                res = ast_set_read_format(chan, AST_FORMAT_SLINEAR, 1);
                 if (res < 0) {
                 	ast_log(LOG_WARNING, "Unable to set to linear mode, giving up\n");
                         return -1;
@@ -633,7 +633,7 @@
 		fdprintf(agi->fd, "200 result=%d (randomerror) endpos=%ld\n", res, sample_offset);
 
         if (silence > 0) {
-                res = ast_set_read_format(chan, rfmt);
+                res = ast_set_read_format(chan, rfmt, 1);
                 if (res)
                         ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name);
                 ast_dsp_free(sildet);
@@ -1484,13 +1484,13 @@
 	int readformat;
 	int res;
 	readformat = chan->readformat;
-	if (ast_set_read_format(chan, AST_FORMAT_SLINEAR)) {
+	if (ast_set_read_format(chan, AST_FORMAT_SLINEAR, 1)) {
 		ast_log(LOG_WARNING, "Unable to set channel '%s' to linear mode\n", chan->name);
 		return -1;
 	}
 	res = agi_exec_full(chan, data, 1, 0);
 	if (!res) {
-		if (ast_set_read_format(chan, readformat)) {
+		if (ast_set_read_format(chan, readformat, 1)) {
 			ast_log(LOG_WARNING, "Unable to restore channel '%s' to format %s\n", chan->name, ast_getformatname(readformat));
 		}
 	}

Index: app_disa.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_disa.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- app_disa.c	1 Sep 2003 15:44:27 -0000	1.9
+++ app_disa.c	27 Mar 2004 06:50:12 -0000	1.10
@@ -129,12 +129,12 @@
 	FILE *fp;
 	char *stringp=NULL;
 
-	if (ast_set_write_format(chan,AST_FORMAT_ULAW))
+	if (ast_set_write_format(chan,AST_FORMAT_ULAW, 1))
 	{
 		ast_log(LOG_WARNING, "Unable to set write format to Mu-law on %s\n",chan->name);
 		return -1;
 	}
-	if (ast_set_read_format(chan,AST_FORMAT_ULAW))
+	if (ast_set_read_format(chan,AST_FORMAT_ULAW, 1))
 	{
 		ast_log(LOG_WARNING, "Unable to set read format to Mu-law on %s\n",chan->name);
 		return -1;

Index: app_echo.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_echo.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- app_echo.c	28 Jun 2003 16:40:02 -0000	1.7
+++ app_echo.c	27 Mar 2004 06:50:12 -0000	1.8
@@ -45,13 +45,15 @@
 	struct localuser *u;
 	struct ast_frame *f;
 	LOCAL_USER_ADD(u);
-	ast_set_write_format(chan, ast_best_codec(chan->nativeformats));
-	ast_set_read_format(chan, ast_best_codec(chan->nativeformats));
+	ast_set_write_format(chan, ast_best_codec(chan->nativeformats), 1);
+	ast_set_read_format(chan, ast_best_codec(chan->nativeformats), 1);
 	/* Do our thing here */
 	while(ast_waitfor(chan, -1) > -1) {
 		f = ast_read(chan);
 		if (!f)
 			break;
+		f->delivery.tv_sec = 0;
+		f->delivery.tv_usec = 0;
 		if (f->frametype == AST_FRAME_VOICE) {
 			if (ast_write(chan, f)) 
 				break;

Index: app_festival.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_festival.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- app_festival.c	24 Mar 2004 22:50:43 -0000	1.15
+++ app_festival.c	27 Mar 2004 06:50:12 -0000	1.16
@@ -158,7 +158,7 @@
 	ast_stopstream(chan);
 
 	owriteformat = chan->writeformat;
-	res = ast_set_write_format(chan, AST_FORMAT_SLINEAR);
+	res = ast_set_write_format(chan, AST_FORMAT_SLINEAR, 1);
 	if (res < 0) {
 		ast_log(LOG_WARNING, "Unable to set write format to signed linear\n");
 		return -1;
@@ -230,7 +230,7 @@
 //	if (pid > -1)
 //		kill(pid, SIGKILL);
 	if (!res && owriteformat)
-		ast_set_write_format(chan, owriteformat);
+		ast_set_write_format(chan, owriteformat, 1);
 	return res;
 }
 

Index: app_intercom.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_intercom.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- app_intercom.c	22 Oct 2003 03:10:24 -0000	1.14
+++ app_intercom.c	27 Mar 2004 06:50:12 -0000	1.15
@@ -138,7 +138,7 @@
 	/* Remember original read format */
 	oreadformat = chan->readformat;
 	/* Set mode to signed linear */
-	res = ast_set_read_format(chan, AST_FORMAT_SLINEAR);
+	res = ast_set_read_format(chan, AST_FORMAT_SLINEAR, 1);
 	if (res < 0) {
 		ast_log(LOG_WARNING, "Unable to set format to signed linear on channel %s\n", chan->name);
 		return -1;
@@ -170,7 +170,7 @@
 	}
 	LOCAL_USER_REMOVE(u);
 	if (!res)
-		ast_set_read_format(chan, oreadformat);
+		ast_set_read_format(chan, oreadformat, 1);
 	return res;
 }
 

Index: app_meetme.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- app_meetme.c	10 Feb 2004 06:47:42 -0000	1.20
+++ app_meetme.c	27 Mar 2004 06:50:12 -0000	1.21
@@ -274,25 +274,25 @@
 
 	if (confflags & CONFFLAG_VIDEO) {	
 		/* Set it into linear mode (write) */
-		if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
+		if (ast_set_write_format(chan, AST_FORMAT_SLINEAR, 1) < 0) {
 			ast_log(LOG_WARNING, "Unable to set '%s' to write linear mode\n", chan->name);
 			goto outrun;
 		}
 
 		/* Set it into linear mode (read) */
-		if (ast_set_read_format(chan, AST_FORMAT_SLINEAR) < 0) {
+		if (ast_set_read_format(chan, AST_FORMAT_SLINEAR, 1) < 0) {
 			ast_log(LOG_WARNING, "Unable to set '%s' to read linear mode\n", chan->name);
 			goto outrun;
 		}
 	} else {
 		/* Set it into U-law mode (write) */
-		if (ast_set_write_format(chan, AST_FORMAT_ULAW) < 0) {
+		if (ast_set_write_format(chan, AST_FORMAT_ULAW, 1) < 0) {
 			ast_log(LOG_WARNING, "Unable to set '%s' to write ulaw mode\n", chan->name);
 			goto outrun;
 		}
 
 		/* Set it into U-law mode (read) */
-		if (ast_set_read_format(chan, AST_FORMAT_ULAW) < 0) {
+		if (ast_set_read_format(chan, AST_FORMAT_ULAW, 1) < 0) {
 			ast_log(LOG_WARNING, "Unable to set '%s' to read ulaw mode\n", chan->name);
 			goto outrun;
 		}

Index: app_milliwatt.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_milliwatt.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- app_milliwatt.c	20 Mar 2004 23:31:40 -0000	1.5
+++ app_milliwatt.c	27 Mar 2004 06:50:12 -0000	1.6
@@ -104,8 +104,8 @@
 
 	struct localuser *u;
 	LOCAL_USER_ADD(u);
-	ast_set_write_format(chan, AST_FORMAT_ULAW);
-	ast_set_read_format(chan, AST_FORMAT_ULAW);
+	ast_set_write_format(chan, AST_FORMAT_ULAW, 1);
+	ast_set_read_format(chan, AST_FORMAT_ULAW, 1);
 	if (chan->_state != AST_STATE_UP)
 	{
 		ast_answer(chan);

Index: app_mp3.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_mp3.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- app_mp3.c	27 Sep 2003 00:30:07 -0000	1.12
+++ app_mp3.c	27 Mar 2004 06:50:12 -0000	1.13
@@ -126,7 +126,7 @@
 	ast_stopstream(chan);
 
 	owriteformat = chan->writeformat;
-	res = ast_set_write_format(chan, AST_FORMAT_SLINEAR);
+	res = ast_set_write_format(chan, AST_FORMAT_SLINEAR, 1);
 	if (res < 0) {
 		ast_log(LOG_WARNING, "Unable to set write format to signed linear\n");
 		return -1;
@@ -190,7 +190,7 @@
 	if (pid > -1)
 		kill(pid, SIGKILL);
 	if (!res && owriteformat)
-		ast_set_write_format(chan, owriteformat);
+		ast_set_write_format(chan, owriteformat, 1);
 	return res;
 }
 

Index: app_qcall.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_qcall.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- app_qcall.c	28 Jan 2004 21:32:48 -0000	1.8
+++ app_qcall.c	27 Mar 2004 06:50:12 -0000	1.9
@@ -219,8 +219,8 @@
 	channel = ast_request(dialstr,AST_FORMAT_SLINEAR,tele);
 	if (channel)
 	   {
-		ast_set_read_format(channel,AST_FORMAT_SLINEAR);
-		ast_set_write_format(channel,AST_FORMAT_SLINEAR);
+		ast_set_read_format(channel,AST_FORMAT_SLINEAR, 1);
+		ast_set_write_format(channel,AST_FORMAT_SLINEAR, 1);
 #ifdef	OURCLID
 		if (channel->callerid)
 			free(channel->callerid);

Index: app_record.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_record.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- app_record.c	22 Mar 2004 04:04:07 -0000	1.14
+++ app_record.c	27 Mar 2004 06:50:12 -0000	1.15
@@ -141,7 +141,7 @@
 
 		if (silence > 0) {
 	        	rfmt = chan->readformat;
-        		res = ast_set_read_format(chan, AST_FORMAT_SLINEAR);
+        		res = ast_set_read_format(chan, AST_FORMAT_SLINEAR, 1);
         		if (res < 0) {
                 		ast_log(LOG_WARNING, "Unable to set to linear mode, giving up\n");
         		        return -1;
@@ -223,7 +223,7 @@
 
 	LOCAL_USER_REMOVE(u);
 	if (silence > 0) {
-	        res = ast_set_read_format(chan, rfmt);
+	        res = ast_set_read_format(chan, rfmt, 1);
         	if (res)
         	        ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name);
 		if (sildet)

Index: app_voicemail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- app_voicemail.c	22 Mar 2004 15:47:32 -0000	1.68
+++ app_voicemail.c	27 Mar 2004 06:50:12 -0000	1.69
@@ -1028,7 +1028,7 @@
 	
 	if (maxsilence > 0) {
 		rfmt = chan->readformat;
-		res = ast_set_read_format(chan, AST_FORMAT_SLINEAR);
+		res = ast_set_read_format(chan, AST_FORMAT_SLINEAR, 1);
 		if (res < 0) {
 			ast_log(LOG_WARNING, "Unable to set to linear mode, giving up\n");
 			return -1;
@@ -1161,7 +1161,7 @@
 		}
 	}
 	if (rfmt) {
-		if (ast_set_read_format(chan, rfmt)) {
+		if (ast_set_read_format(chan, rfmt, 1)) {
 			ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
 		}
 	}
@@ -1239,7 +1239,7 @@
 	
 	if (maxsilence > 0) {
 		rfmt = chan->readformat;
-		res = ast_set_read_format(chan, AST_FORMAT_SLINEAR);
+		res = ast_set_read_format(chan, AST_FORMAT_SLINEAR, 1);
 		if (res < 0) {
 			ast_log(LOG_WARNING, "Unable to set to linear mode, giving up\n");
 			return -1;
@@ -1344,7 +1344,7 @@
 		ast_closestream(others[x]);
 	}
 	if (rfmt) {
-		if (ast_set_read_format(chan, rfmt)) {
+		if (ast_set_read_format(chan, rfmt, 1)) {
 			ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
 		}
 	}

Index: app_zapbarge.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_zapbarge.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- app_zapbarge.c	4 Feb 2003 15:48:42 -0000	1.1
+++ app_zapbarge.c	27 Mar 2004 06:50:12 -0000	1.2
@@ -93,13 +93,13 @@
 	char *buf = __buf + AST_FRIENDLY_OFFSET;
 
 	/* Set it into U-law mode (write) */
-	if (ast_set_write_format(chan, AST_FORMAT_ULAW) < 0) {
+	if (ast_set_write_format(chan, AST_FORMAT_ULAW, 1) < 0) {
 		ast_log(LOG_WARNING, "Unable to set '%s' to write ulaw mode\n", chan->name);
 		goto outrun;
 	}
 
 	/* Set it into U-law mode (read) */
-	if (ast_set_read_format(chan, AST_FORMAT_ULAW) < 0) {
+	if (ast_set_read_format(chan, AST_FORMAT_ULAW, 1) < 0) {
 		ast_log(LOG_WARNING, "Unable to set '%s' to read ulaw mode\n", chan->name);
 		goto outrun;
 	}

Index: app_zapscan.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_zapscan.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- app_zapscan.c	19 Mar 2004 03:46:01 -0000	1.5
+++ app_zapscan.c	27 Mar 2004 06:50:12 -0000	1.6
@@ -93,13 +93,13 @@
         char *buf = __buf + AST_FRIENDLY_OFFSET;
 
         /* Set it into U-law mode (write) */
-        if (ast_set_write_format(chan, AST_FORMAT_ULAW) < 0) {
+        if (ast_set_write_format(chan, AST_FORMAT_ULAW, 1) < 0) {
                 ast_log(LOG_WARNING, "Unable to set '%s' to write ulaw mode\n", chan->name);
                 goto outrun;
         }
 
         /* Set it into U-law mode (read) */
-        if (ast_set_read_format(chan, AST_FORMAT_ULAW) < 0) {
+        if (ast_set_read_format(chan, AST_FORMAT_ULAW, 1) < 0) {
                 ast_log(LOG_WARNING, "Unable to set '%s' to read ulaw mode\n", chan->name);
                 goto outrun;
         }




More information about the svn-commits mailing list