From b0972b8d1ff624462ddd8dfcc9389611d972c32a Mon Sep 17 00:00:00 2001
From: Mark Spencer <markster@digium.com>
Date: Thu, 24 Jun 2004 13:27:44 +0000
Subject: [PATCH] Make sure other drivers also zero delivery (thanks to steven
 davies)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 channels/chan_alsa.c           | 3 +++
 channels/chan_modem_aopen.c    | 4 ++++
 channels/chan_modem_bestdata.c | 4 ++++
 channels/chan_modem_i4l.c      | 4 ++++
 channels/chan_nbs.c            | 2 ++
 channels/chan_oss.c            | 4 ++++
 channels/chan_phone.c          | 4 ++++
 channels/chan_vofr.c           | 2 ++
 channels/chan_vpb.c            | 2 ++
 9 files changed, 29 insertions(+)

diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c
index d78ee0f205..4eb451e19c 100755
--- a/channels/chan_alsa.c
+++ b/channels/chan_alsa.c
@@ -664,6 +664,9 @@ static struct ast_frame *alsa_read(struct ast_channel *chan)
 	f.offset = 0;
 	f.src = type;
 	f.mallocd = 0;
+        f.delivery.tv_sec = 0;
+        f.delivery.tv_usec = 0;
+
 	
 	if (needringing) {
 		f.frametype = AST_FRAME_CONTROL;
diff --git a/channels/chan_modem_aopen.c b/channels/chan_modem_aopen.c
index c123bfddff..4d18137f05 100755
--- a/channels/chan_modem_aopen.c
+++ b/channels/chan_modem_aopen.c
@@ -190,6 +190,8 @@ static struct ast_frame *aopen_handle_escape(struct ast_modem_pvt *p, char esc)
 	p->fr.samples = 0;
 	p->fr.offset = 0;
 	p->fr.mallocd = 0;
+        p->fr.delivery.tv_sec = 0;
+        p->fr.delivery.tv_usec = 0;
 	if (esc)
 		ast_log(LOG_DEBUG, "Escaped character '%c'\n", esc);
 	
@@ -319,6 +321,8 @@ static struct ast_frame *aopen_read(struct ast_modem_pvt *p)
 		p->fr.data = p->obuf;
 		p->fr.datalen = p->obuflen;
 		p->fr.mallocd = 0;
+		p->fr.delivery.tv_sec = 0;
+		p->fr.delivery.tv_usec = 0;
 		p->fr.offset = AST_FRIENDLY_OFFSET;
 		p->fr.src = __FUNCTION__;
 		if (option_debug)
diff --git a/channels/chan_modem_bestdata.c b/channels/chan_modem_bestdata.c
index 7eca765199..2fde4d4db6 100755
--- a/channels/chan_modem_bestdata.c
+++ b/channels/chan_modem_bestdata.c
@@ -164,6 +164,8 @@ static struct ast_frame *bestdata_handle_escape(struct ast_modem_pvt *p, char es
 	p->fr.samples = 0;
 	p->fr.offset = 0;
 	p->fr.mallocd = 0;
+	p->fr.delivery.tv_sec = 0;
+	p->fr.delivery.tv_usec = 0;
 	if (esc)
 		ast_log(LOG_DEBUG, "Escaped character '%c'\n", esc);
 	
@@ -369,6 +371,8 @@ static struct ast_frame *bestdata_read(struct ast_modem_pvt *p)
 		p->fr.data = p->obuf;
 		p->fr.datalen = p->obuflen;
 		p->fr.mallocd = 0;
+		p->fr.delivery.tv_sec = 0;
+		p->fr.delivery.tv_usec = 0;
 		p->fr.offset = AST_FRIENDLY_OFFSET;
 		p->fr.src = __FUNCTION__;
 		if (option_debug)
diff --git a/channels/chan_modem_i4l.c b/channels/chan_modem_i4l.c
index ce7de41740..892f4c09f1 100755
--- a/channels/chan_modem_i4l.c
+++ b/channels/chan_modem_i4l.c
@@ -236,6 +236,8 @@ static struct ast_frame *i4l_handle_escape(struct ast_modem_pvt *p, char esc)
 	p->fr.samples = 0;
 	p->fr.offset = 0;
 	p->fr.mallocd = 0;
+	p->fr.delivery.tv_sec = 0;
+	p->fr.delivery.tv_usec = 0;
 	if (esc && option_debug)
 		ast_log(LOG_DEBUG, "Escaped character '%c'\n", esc);
 	
@@ -438,6 +440,8 @@ static struct ast_frame *i4l_read(struct ast_modem_pvt *p)
 		p->fr.data = p->obuf;
 		p->fr.datalen = p->obuflen;
 		p->fr.mallocd = 0;
+		p->fr.delivery.tv_sec = 0;
+		p->fr.delivery.tv_usec = 0;
 		p->fr.offset = AST_FRIENDLY_OFFSET;
 		p->fr.src = __FUNCTION__;
 		p->obuflen = 0;
diff --git a/channels/chan_nbs.c b/channels/chan_nbs.c
index b30e1fadbd..3ec1555e76 100755
--- a/channels/chan_nbs.c
+++ b/channels/chan_nbs.c
@@ -160,6 +160,8 @@ static struct ast_frame  *nbs_xread(struct ast_channel *ast)
 	p->fr.src = type;
 	p->fr.offset = 0;
 	p->fr.mallocd=0;
+	p->fr.delivery.tv_sec = 0;
+	p->fr.delivery.tv_usec = 0;
 
 	ast_log(LOG_DEBUG, "Returning null frame on %s\n", ast->name);
 
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index 7bd7ddb8c5..46d4e2cdf7 100755
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -615,6 +615,8 @@ static struct ast_frame *oss_read(struct ast_channel *chan)
 	f.offset = 0;
 	f.src = type;
 	f.mallocd = 0;
+	f.delivery.tv_sec = 0;
+	f.delivery.tv_usec = 0;
 	
 	res = soundcard_setinput(0);
 	if (res < 0) {
@@ -650,6 +652,8 @@ static struct ast_frame *oss_read(struct ast_channel *chan)
 		f.offset = AST_FRIENDLY_OFFSET;
 		f.src = type;
 		f.mallocd = 0;
+		f.delivery.tv_sec = 0;
+		f.delivery.tv_usec = 0;
 #if 0
 		{ static int fd = -1;
 		  if (fd < 0)
diff --git a/channels/chan_phone.c b/channels/chan_phone.c
index 69c0884bd1..536d3ef866 100755
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -368,6 +368,8 @@ static struct ast_frame  *phone_exception(struct ast_channel *ast)
 	p->fr.src = type;
 	p->fr.offset = 0;
 	p->fr.mallocd=0;
+	p->fr.delivery.tv_sec = 0;
+	p->fr.delivery.tv_usec = 0;
 
 	phonee.bytes = ioctl(p->fd, PHONE_EXCEPTION);
 	if (phonee.bits.dtmf_ready)  {
@@ -429,6 +431,8 @@ static struct ast_frame  *phone_read(struct ast_channel *ast)
 	p->fr.src = type;
 	p->fr.offset = 0;
 	p->fr.mallocd=0;
+	p->fr.delivery.tv_sec = 0;
+	p->fr.delivery.tv_usec = 0;
 
 	/* Try to read some data... */
 	CHECK_BLOCKING(ast);
diff --git a/channels/chan_vofr.c b/channels/chan_vofr.c
index 43e7271d98..b249de10d8 100755
--- a/channels/chan_vofr.c
+++ b/channels/chan_vofr.c
@@ -587,6 +587,8 @@ retry:
 	fr->src = type;
 	fr->offset = 0;
 	fr->mallocd=0;
+	fr->delivery.tv_sec = 0;
+	fr->delivery.tv_usec = 0;
 	
 	/* Now, what we do depends on what we read */
 	switch(vh->dtype) {
diff --git a/channels/chan_vpb.c b/channels/chan_vpb.c
index bd4576b8f8..e2562124b1 100755
--- a/channels/chan_vpb.c
+++ b/channels/chan_vpb.c
@@ -1568,6 +1568,8 @@ static void *do_chanreads(void *pvt)
 	fr->frametype = AST_FRAME_VOICE;
 	fr->src = type;
 	fr->mallocd = 0;
+	fr->delivery.tv_sec = 0;
+	fr->delivery.tv_usec = 0;
 	fr->samples = VPB_SAMPLES;
 	fr->offset = AST_FRIENDLY_OFFSET;
 	memset(p->buf, 0, sizeof p->buf);
-- 
GitLab