aboutsummaryrefslogtreecommitdiffstats
path: root/net/freeswitch-core/files
diff options
context:
space:
mode:
authorJosh Paetzel <jpaetzel@FreeBSD.org>2010-06-12 06:26:45 +0800
committerJosh Paetzel <jpaetzel@FreeBSD.org>2010-06-12 06:26:45 +0800
commiteff58e21921822e1ce29ba02ddfb4a38695813ec (patch)
treebdb0279e3dc1201f70cb079c77883af54578d192 /net/freeswitch-core/files
parent5d8bca0e74767a9c8298647429216ce05ba510f0 (diff)
downloadfreebsd-ports-gnome-eff58e21921822e1ce29ba02ddfb4a38695813ec.tar.gz
freebsd-ports-gnome-eff58e21921822e1ce29ba02ddfb4a38695813ec.tar.zst
freebsd-ports-gnome-eff58e21921822e1ce29ba02ddfb4a38695813ec.zip
Add net/freeswitch-core, part of a revamp to the freeswitch ports
PR: ports/145369 Submitted by: Eric F Crist <ecrist@secure-computing.net> Approved by: itetcu@ (mentor)
Diffstat (limited to 'net/freeswitch-core/files')
-rw-r--r--net/freeswitch-core/files/freeswitch.in70
-rw-r--r--net/freeswitch-core/files/patch-Makefile.am13
-rw-r--r--net/freeswitch-core/files/patch-libs-openzap-src-ozmod-ozmod_zt-ozmod_zt.c73
-rw-r--r--net/freeswitch-core/files/patch-src-switch.c14
-rw-r--r--net/freeswitch-core/files/pkg-install.in35
-rw-r--r--net/freeswitch-core/files/pkg-message.in20
6 files changed, 225 insertions, 0 deletions
diff --git a/net/freeswitch-core/files/freeswitch.in b/net/freeswitch-core/files/freeswitch.in
new file mode 100644
index 000000000000..0e5ead8bb421
--- /dev/null
+++ b/net/freeswitch-core/files/freeswitch.in
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+# PROVIDE: freeswitch
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable freeswitch:
+#
+# freeswitch_enable="YES"
+#
+#
+# freeswitch_user="freeswitch"
+# freeswitch_group="freeswitch"
+
+. /etc/rc.subr
+
+freeswitch_enable=${freeswitch_enable:-"NO"}
+freeswitch_user=${freeswitch_user:-"freeswitch"}
+freeswitch_group=${freeswitch_group:-"freeswitch"}
+freeswitch_flags=${freeswitch_flags:-""}
+
+name=freeswitch
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/bin/freeswitch
+command_args="-nc -u ${freeswitch_user} -g ${freeswitch_group} ${freeswitch_flags} -db /var/db/freeswitch -log /var/log/freeswitch/"
+
+pidfile=${freeswitch_pidfile:-"/var/run/freeswitch.pid"}
+
+start_cmd="freeswitch_start"
+stop_precmd="freeswitch_stop"
+restart_cmd="freeswitch_restart"
+
+sig_stop=KILL
+
+load_rc_config $name
+
+freeswitch_stop () {
+ echo "Stopping FreeSWITCH."
+ %%PREFIX%%/bin/freeswitch -stop
+ sleep 1
+ return 0
+}
+
+freeswitch_start () {
+ echo "Starting FreeSWITCH."
+ $command $command_args
+ sleep 1
+ return
+}
+
+freeswitch_restart () {
+ echo "Restarting FreeSwitch."
+ freeswitch_stop
+ if [ $? -eq 0 ];
+ then
+ status=$?
+ freeswitch_start
+ sleep 1
+ return 0
+ else
+ echo "Problem stoping FreeSWITCH: $status"
+ sleep 1
+ return 1
+ fi
+}
+
+run_rc_command "$1"
+
diff --git a/net/freeswitch-core/files/patch-Makefile.am b/net/freeswitch-core/files/patch-Makefile.am
new file mode 100644
index 000000000000..10431d0b0045
--- /dev/null
+++ b/net/freeswitch-core/files/patch-Makefile.am
@@ -0,0 +1,13 @@
+--- Makefile.am.orig 2010-05-11 15:58:08.000000000 -0700
++++ Makefile.am 2010-05-12 20:01:14.000000000 -0700
+@@ -450,8 +450,8 @@
+ @echo Installing $(NAME)
+ @for x in $(modulesdir) $(runtimedir) $(dbdir) $(logfiledir) $(logfiledir)/xml_cdr $(bindir) $(scriptdir) $(recordingsdir) $(grammardir); do \
+ $(mkinstalldirs) $(DESTDIR)$$x ; \
+- done
+- test -d $(DESTDIR)$(sysconfdir) || $(MAKE) samples-conf
++ done
++ test -d $(DESTDIR)$(sysconfdir) || $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
+ test -d $(DESTDIR)$(htdocsdir) || $(MAKE) samples-htdocs
+
+ is-scm:
diff --git a/net/freeswitch-core/files/patch-libs-openzap-src-ozmod-ozmod_zt-ozmod_zt.c b/net/freeswitch-core/files/patch-libs-openzap-src-ozmod-ozmod_zt-ozmod_zt.c
new file mode 100644
index 000000000000..2fbbe1f489dc
--- /dev/null
+++ b/net/freeswitch-core/files/patch-libs-openzap-src-ozmod-ozmod_zt-ozmod_zt.c
@@ -0,0 +1,73 @@
+--- libs/openzap/src/ozmod/ozmod_zt/ozmod_zt.c.orig 2010-04-26 14:17:55.000000000 -0700
++++ libs/openzap/src/ozmod/ozmod_zt/ozmod_zt.c 2010-04-26 14:22:56.000000000 -0700
+@@ -52,38 +52,38 @@
+ * \brief General IOCTL codes
+ */
+ struct ioctl_codes {
+- int GET_BLOCKSIZE;
+- int SET_BLOCKSIZE;
+- int FLUSH;
+- int SYNC;
+- int GET_PARAMS;
+- int SET_PARAMS;
+- int HOOK;
+- int GETEVENT;
+- int IOMUX;
+- int SPANSTAT;
+- int MAINT;
+- int GETCONF;
+- int SETCONF;
+- int CONFLINK;
+- int CONFDIAG;
+- int GETGAINS;
+- int SETGAINS;
+- int SPANCONFIG;
+- int CHANCONFIG;
+- int SET_BUFINFO;
+- int GET_BUFINFO;
+- int AUDIOMODE;
+- int ECHOCANCEL;
+- int HDLCRAWMODE;
+- int HDLCFCSMODE;
+- int SPECIFY;
+- int SETLAW;
+- int SETLINEAR;
+- int GETCONFMUTE;
+- int ECHOTRAIN;
+- int SETTXBITS;
+- int GETRXBITS;
++ long GET_BLOCKSIZE;
++ long SET_BLOCKSIZE;
++ long FLUSH;
++ long SYNC;
++ long GET_PARAMS;
++ long SET_PARAMS;
++ long HOOK;
++ long GETEVENT;
++ long IOMUX;
++ long SPANSTAT;
++ long MAINT;
++ long GETCONF;
++ long SETCONF;
++ long CONFLINK;
++ long CONFDIAG;
++ long GETGAINS;
++ long SETGAINS;
++ long SPANCONFIG;
++ long CHANCONFIG;
++ long SET_BUFINFO;
++ long GET_BUFINFO;
++ long AUDIOMODE;
++ long ECHOCANCEL;
++ long HDLCRAWMODE;
++ long HDLCFCSMODE;
++ long SPECIFY;
++ long SETLAW;
++ long SETLINEAR;
++ long GETCONFMUTE;
++ long ECHOTRAIN;
++ long SETTXBITS;
++ long GETRXBITS;
+ };
+
+ /**
diff --git a/net/freeswitch-core/files/patch-src-switch.c b/net/freeswitch-core/files/patch-src-switch.c
new file mode 100644
index 000000000000..799ad2341adf
--- /dev/null
+++ b/net/freeswitch-core/files/patch-src-switch.c
@@ -0,0 +1,14 @@
+--- src/switch.c.orig 2010-05-11 23:58:27.000000000 -0700
++++ src/switch.c 2010-05-12 00:19:56.000000000 -0700
+@@ -661,11 +661,6 @@
+ return 255;
+ }
+
+- if (alt_dirs && alt_dirs != 3) {
+- fprintf(stderr, "You must specify all or none of -conf, -log, and -db\n");
+- return 255;
+- }
+-
+ signal(SIGILL, handle_SIGILL);
+ signal(SIGTERM, handle_SIGILL);
+
diff --git a/net/freeswitch-core/files/pkg-install.in b/net/freeswitch-core/files/pkg-install.in
new file mode 100644
index 000000000000..7237295def60
--- /dev/null
+++ b/net/freeswitch-core/files/pkg-install.in
@@ -0,0 +1,35 @@
+#!/bin/sh
+# $FreeBSD: /tmp/pcvs/ports/net/freeswitch-core/files/pkg-install.in,v 1.1 2010-06-11 22:26:44 jpaetzel Exp $
+#
+
+if [ "$2" != "PRE-INSTALL" ]; then
+ exit 0
+fi
+
+FREESWITCHUSER=%%FREESWITCH_USER%%
+FREESWITCHGROUP=%%FREESWITCH_GROUP%%
+FREESWITCHUID=%%UID%%
+FREESWITCHGID=%%GID%%
+
+if ! pw groupshow "${FREESWITCHGROUP}" 2>/dev/null 1>&2; then
+ if pw groupadd ${FREESWITCHGROUP} -g ${FREESWITCHGID}; then
+ echo "Added group \"${FREESWITCHGROUP}\"."
+ else
+ echo "Adding group \"${FREESWITCHGROUP}\" failed..."
+ exit 1
+ fi
+fi
+
+if ! pw usershow "${FREESWITCHUSER}" 2>/dev/null 1>&2; then
+ if pw useradd ${FREESWITCHUSER} -u ${FREESWITCHUID} -g ${FREESWITCHGROUP} -h - \
+ -s "/sbin/nologin" -d "/nonexistent" \
+ -c "FREESWITCH Owner"; \
+ then
+ echo "Added user \"${FREESWITCHUSER}\"."
+ else
+ echo "Adding user \"${FREESWITCHUSER}\" failed..."
+ exit 1
+ fi
+fi
+
+exit 0
diff --git a/net/freeswitch-core/files/pkg-message.in b/net/freeswitch-core/files/pkg-message.in
new file mode 100644
index 000000000000..435a4e7b8ea4
--- /dev/null
+++ b/net/freeswitch-core/files/pkg-message.in
@@ -0,0 +1,20 @@
+
+*****************************************************
+* Please read *
+*****************************************************
+ FreeBSD 7.x
+There are some known issues with FreeBSD's libpthread
+implementation and APR that can affect throughput at
+high volume. A possible fix is to use libmap.conf to
+remap FreeSWITCH. and its libraries to use libthr
+(the better performance threading library)
+
+/etc/libmap.conf
+
+[freeswitch]
+libc_r.so.5 libthr.so.2
+libc_r.so.6 libthr.so.2
+libpthread.so.1 libthr.so.2
+libpthread.so.2 libthr.so.2
+
+