Subject: [alpine-devel] [PATCH] Updated freeswitch.initd to include missing path switches.

From: Tobie Booth <[email-masked]>
Date: Sun, 13 Apr 2014 01:53:01 -0500

Changed the freeswitch package's freeswitch.initd to include the switches
for the grammar, recordings, storage, and sounds directories. Currently
without them it's trying to use the default /usr prefix making voicemail
and other things unusable out of the box.

The switches are set as follows:
Recordings - /var/lib/freeswitch/recordings (this directory already exists)
Grammar - /var/lib/freeswitch/grammar (this directory already exists)
Sounds - /usr/share/freeswitch/sounds (this directory already exists)
Storage - /var/lib/freeswitch/ (this will cause http_file_cache and
	voicemail directories to be created on first start)

Thanks.
---
 main/freeswitch/freeswitch.initd | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/main/freeswitch/freeswitch.initd b/main/freeswitch/freeswitch.initd
index cc9bac4..c56a49d 100755
--- a/main/freeswitch/freeswitch.initd
+++ b/main/freeswitch/freeswitch.initd
@@ -31,8 +31,12 @@ start() {
 		-- \
 		-nc -conf /etc/freeswitch -log /var/log/freeswitch \
 		-run /var/run/freeswitch -db /var/lib/freeswitch/db \
+		-recordings /var/lib/freeswitch/recordings \
+		-grammar /var/lib/freeswitch/grammar \
+		-sounds /usr/share/freeswitch/sounds \
 		-htdocs /usr/share/freeswitch/htdocs \
-		-scripts /etc/freeswitch/scripts ${OPTS}
+		-scripts /etc/freeswitch/scripts \
+		-storage /var/lib/freeswitch ${OPTS}
 	eend $?
 }
 
-- 
1.8.4.3

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Der Tiger <[email-masked]>
Date: Sun, 13 Apr 2014 09:32:55 +0200

Hi,

In order to make those switches adjustable by the user, I suggest to set
them in /etc/conf.d/freeswitch utilizing the ${OPTS} variable in the
init.d script rather than make them hard-coded in /etc/init.d/freeswitch
itself, because some folks my want to store recordings on a different
drive or use their own set of grammar and voice files.

So Long, Tiger

---

---

From: Natanael Copa <[email-masked]>
Date: Sun, 13 Apr 2014 07:59:57 +0000

On Sun, 13 Apr 2014 09:32:55 +0200

> drive or use their own set of grammar and voice files.

Yes, and it will break things for those who actually have things stored
other location.

Maybe we should introduce variables with sane values:

 -recordings ${recordings_dir:-/var/lib/freeswitch/recordings} \
 -grammar ${grammar_dir:-/var/lib/freeswitch/grammar} \
 -sounds ${sounds_dir:-/usr/share/freeswitch/sounds} \
 -storage ${storage_dir:-/var/lib/freeswitch} \
 ${OPTS}

---

---

From: Der Tiger <[email-masked]>
Date: Sun, 13 Apr 2014 12:48:41 +0200

Natanael,

> Yes, and it will break things for those who actually have things stored
I don't see why pre-setting ${OPTS} in /etc/conf.d/freeswitch would
break anything for anyone. Anyway, introducing separate variables for
each switch, as you suggested, is certainly the better way to go.

>  -storage ${storage_dir:-/var/lib/freeswitch} \
Regards, Tiger

---

---

From: Natanael Copa <[email-masked]>
Date: Mon, 14 Apr 2014 06:26:47 +0000

On Sun, 13 Apr 2014 12:48:41 +0200

> each switch, as you suggested, is certainly the better way to go.

Sorry, I was unclear. What I meant was that hardcoding the paths in
init.d will not only prevent people to store things in other location
if they want. It will break things for those who already does it.

Relying on $OPTS only will not break that, but otoh it will not solve
the problem Tobie wants to solve either: a working default config.

-nc

---

---

From: Tobie Booth <[email-masked]>
Date: Sun, 13 Apr 2014 03:37:01 -0500

I definitely think that would be the way to go. 

The problem is, in my mind (possibly spoiled by other distros) I expect to install freeswitch, freeswitch-sample-config, and freeswitch-sounds-* and have at least voicemail and other basic apps. However they fail and crash due to the incorrect file paths. Do you guys agree/disagree with this thought process? 

Unfortunately they can only be changed globally via the switches.

> On April 13, 2014 at 3:00:02 AM, Natanael Copa ([email-masked]) wrote:

---

From: Natanael Copa <[email-masked]>
Date: Mon, 14 Apr 2014 06:32:38 +0000

On Sun, 13 Apr 2014 03:37:01 -0500

> The problem is, in my mind (possibly spoiled by other distros) I expect to install freeswitch, freeswitch-sample-config, and freeswitch-sounds-* and have at least voicemail and other basic apps. Ho…

I definitively agree. We want default configs to just work if possible.
I was just not aware that it didn't.

Could you please file a new issue for it on bugs.alpinelinux.org, so I
don't forget it.

> Unfortunately they can only be changed globally via the switches.

I did try fix the default locations to be configurable at build time
but I don't remember if I ever made it work. The intention was to store
data in /var/lib/freeswitch by default.

http://jira.freeswitch.org/browse/FS-302

Another unrelated issue is that it does not currently build with musl
libc and we need to fix that before 3.0 release.

-nc

---

---

From: Tobie Booth <[email-masked]>
Date: Mon, 14 Apr 2014 02:12:51 -0500

> Could you please file a new issue for it on bugs.alpinelinux.org, so I  

Done: https://bugs.alpinelinux.org/issues/2841

> http://jira.freeswitch.org/browse/FS-302 

Hmm interesting. Might see if that still works in 1.4.0 if I find the time.

> libc and we need to fix that before 3.0 release.  

Yea, TL;DR we’re looking at using Alpine as the basis for one of our VoIP on-site PBX solutions. In the end we’ll have our own repo with our proprietary stuff in it but would love to use any of the packages we need that already exist. Regarding that would love to help out any way we can to get make sure the Freeswitch-* packages stay current/working. Unfortunately none of us are any good at C so I wouldn’t even know where to start on that lol.

---

From: Natanael Copa <[email-masked]>
Date: Mon, 14 Apr 2014 10:22:54 +0200

On Mon, 14 Apr 2014 02:12:51 -0500
Tobie Booth <[email-masked]> wrote:

> Yea, TL;DR we*re looking at using Alpine as the basis for one of our VoIP on-site PBX solutions. In the end we*ll have our own repo with our proprietary stuff in it but would love to use any of the packages we need that already exist. Regarding that would love to help out any way we can to get make sure the Freeswitch-* packages stay current/working. Unfortunately none of us are any good at C so I wouldn*t even know where to start on that lol.

Other thing I just realized is that the current stable freeswitch
branch seems to be v1.2. They did v1.2.23 in March 19, 2014, while latest
v1.4 was 12 July 2013. v1.4 seems to be a beta branch.

Oh, they actually do 'releases', at least they do release tags once in a while:
http://git.freeswitch.org/git/freeswitch/

v1.5.11 is tagged.

But they don't upload those to http://files.freeswitch.org/

I have always found the freeswitch release engineering very confusing.

If someonw has any good ideas what to do with freeswitch (eg which
version do we ship with alpine 3.0), please let me know.

 -nc

---

---

From: Tobie Booth <[email-masked]>
Date: Mon, 14 Apr 2014 10:54:47 -0500

On April 14, 2014 at 3:23:00 AM, Natanael Copa ([email-masked]) wrote:

v1.5.11 is tagged. 

-nc 

Yea I could understand how that could be confusing. I think a lot of it stems from the fact that master on the git used to be considered stable (tagged versions only existed to please other distros by having a tagged stable). They’ve recently changed that and started going back to 1.2.* = stable, 1.4.* = beta, master = dev. So technically I think the packaged version in main should be 1.2.*.