From 3e9c3379464043cdb325c40575a8c4225b204e5f Mon Sep 17 00:00:00 2001
From: Mark Spencer <markster@digium.com>
Date: Mon, 29 Mar 2004 08:20:35 +0000
Subject: [PATCH] Small SIP fix, voicemail fix, and some delivery fixes on new
 apps

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 apps/app_mp3.c       | 2 ++
 apps/app_nbscat.c    | 2 ++
 apps/app_voicemail.c | 2 +-
 channels/chan_sip.c  | 2 ++
 4 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/apps/app_mp3.c b/apps/app_mp3.c
index 7f7d318498..2ada2ab9dd 100755
--- a/apps/app_mp3.c
+++ b/apps/app_mp3.c
@@ -170,6 +170,8 @@ static int mp3_exec(struct ast_channel *chan, void *data)
 					myf.f.mallocd = 0;
 					myf.f.offset = AST_FRIENDLY_OFFSET;
 					myf.f.src = __PRETTY_FUNCTION__;
+					myf.f.delivery.tv_sec = 0;
+					myf.f.delivery.tv_usec = 0;
 					myf.f.data = myf.frdata;
 					if (ast_write(chan, &myf.f) < 0) {
 						res = -1;
diff --git a/apps/app_nbscat.c b/apps/app_nbscat.c
index 6c28085516..3499f5500b 100755
--- a/apps/app_nbscat.c
+++ b/apps/app_nbscat.c
@@ -150,6 +150,8 @@ static int NBScat_exec(struct ast_channel *chan, void *data)
 					myf.f.subclass = AST_FORMAT_SLINEAR;
 					myf.f.datalen = res;
 					myf.f.samples = res / 2;
+					myf.f.delivery.tv_usec = 0;
+					myf.f.delivery.tv_sec = 0;
 					myf.f.mallocd = 0;
 					myf.f.offset = AST_FRIENDLY_OFFSET;
 					myf.f.src = __PRETTY_FUNCTION__;
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 5e562e3336..98a79e13a8 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -849,7 +849,7 @@ static int sendpage(char *srcemail, char *pager, int msgnum, char *mailbox, char
 	time_t t;
 	struct tm tm;
 	struct vm_zone *the_zone = NULL;
-	p = popen(mailcmd, "w");
+	pfd = mkstemp(tmp);
 
 	if (pfd > -1) {
 		p = fdopen(pfd, "w");
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index cd28802266..4bf4642747 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -3282,6 +3282,8 @@ static int transmit_register(struct sip_registry *r, char *cmd, char *auth, char
 	snprintf(addr, sizeof(addr), "sip:%s", r->hostname);
 	strncpy(p->uri, addr, sizeof(p->uri) - 1);
 
+	p->branch ^= rand();
+
 	memset(&req, 0, sizeof(req));
 	init_req(&req, cmd, addr);
 
-- 
GitLab