[Asterisk-cvs] asterisk/apps app_rpt.c,1.33,1.34
jim at lists.digium.com
jim at lists.digium.com
Tue Jun 14 23:48:58 CDT 2005
Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv14644/apps
Modified Files:
app_rpt.c
Log Message:
Fixed transmitter hang problem
Index: app_rpt.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_rpt.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- app_rpt.c 6 Jun 2005 22:39:31 -0000 1.33
+++ app_rpt.c 15 Jun 2005 03:50:29 -0000 1.34
@@ -3,7 +3,7 @@
* Asterisk -- A telephony toolkit for Linux.
*
* Radio Repeater / Remote Base program
- * version 0.24 05/15/05
+ * version 0.25 06/14/05
*
* See http://www.zapatatelephony.org/app_rpt.html
*
@@ -120,6 +120,10 @@
enum {DLY_TELEM, DLY_ID, DLY_UNKEY, DLY_CALLTERM};
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
@@ -140,10 +144,6 @@
#include <tonezone.h>
#include <linux/zaptel.h>
-#include "asterisk.h"
-
-ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-
#include "asterisk/utils.h"
#include "asterisk/lock.h"
#include "asterisk/file.h"
@@ -159,7 +159,7 @@
#include "asterisk/say.h"
#include "asterisk/localtime.h"
-static char *tdesc = "Radio Repeater / Remote Base version 0.24 05/15/2005";
+static char *tdesc = "Radio Repeater / Remote Base version 0.25 06/14/2005";
static char *app = "Rpt";
@@ -409,7 +409,6 @@
static int play_tone_pair(struct ast_channel *chan, int f1, int f2, int duration, int amplitude)
{
- int flags = ZT_IOMUX_WRITEEMPTY;
int res;
if ((res = ast_tonepair_start(chan, f1, f2, duration, amplitude)))
@@ -419,13 +418,6 @@
if (ast_safe_sleep(chan,1)) return -1;
}
- /*
- * Wait for the zaptel driver to physically write the tone blocks to the hardware
- */
-
- res = ioctl(chan->fds[0], ZT_IOMUX, &flags);
- if (res < 0)
- return -1;
return 0;
}
@@ -514,8 +506,9 @@
int len, ddcomb;
int res;
int c;
-
-
+ int i;
+ int flags;
+
res = 0;
/* Approximate the dot time from the speed arg. */
@@ -581,7 +574,23 @@
if (!res)
res = ast_waitstream(chan, "");
ast_stopstream(chan);
-
+
+ /*
+ * Wait for the zaptel driver to physically write the tone blocks to the hardware
+ */
+
+ for(i = 0; i < 20 ; i++){
+ flags = ZT_IOMUX_WRITEEMPTY | ZT_IOMUX_NOWAIT;
+ res = ioctl(chan->fds[0], ZT_IOMUX, &flags);
+ if(flags & ZT_IOMUX_WRITEEMPTY)
+ break;
+ if( ast_safe_sleep(chan, 50)){
+ res = -1;
+ break;
+ }
+ }
+
+
return res;
}
@@ -593,6 +602,8 @@
int duration;
int amplitude;
int res;
+ int i;
+ int flags;
res = 0;
@@ -614,7 +625,22 @@
if (!res)
res = ast_waitstream(chan, "");
ast_stopstream(chan);
-
+
+ /*
+ * Wait for the zaptel driver to physically write the tone blocks to the hardware
+ */
+
+ for(i = 0; i < 20 ; i++){
+ flags = ZT_IOMUX_WRITEEMPTY | ZT_IOMUX_NOWAIT;
+ res = ioctl(chan->fds[0], ZT_IOMUX, &flags);
+ if(flags & ZT_IOMUX_WRITEEMPTY)
+ break;
+ if( ast_safe_sleep(chan, 50)){
+ res = -1;
+ break;
+ }
+ }
+
return res;
}
More information about the svn-commits
mailing list