net/freeswitch: Fixed restart so that it waits for FS to terminated before attempting...
authorDaniel Dickinson <crazycshore@gmail.com>
Sun, 27 Jun 2010 13:36:24 +0000 (13:36 +0000)
committerDaniel Dickinson <crazycshore@gmail.com>
Sun, 27 Jun 2010 13:36:24 +0000 (13:36 +0000)
SVN-Revision: 21964

net/freeswitch/Makefile
net/freeswitch/files/freeswitch.init

index 2539b43969055adae061084a964f876059e3e1b8..e3da8a00f019e6a360854f6026783a52bdf478ea 100644 (file)
@@ -181,7 +181,8 @@ $(call Package/freeswitch/Default)
                +freeswitch-mod-tone-stream \
                +freeswitch-mod-voipcodecs \
                +freeswitch-mod-xml-curl \
                +freeswitch-mod-tone-stream \
                +freeswitch-mod-voipcodecs \
                +freeswitch-mod-xml-curl \
-               +freeswitch-mod-xml-rpc
+               +freeswitch-mod-xml-rpc \
+               +freeswitch-tools
 endef
 
 # mod_lua is included in FreeSWITCH minimal because it is intended to be used
 endef
 
 # mod_lua is included in FreeSWITCH minimal because it is intended to be used
@@ -195,12 +196,14 @@ $(call Package/freeswitch/Default)
                +freeswitch-mod-console \
                +freeswitch-mod-dialplan-xml \
                +freeswitch-mod-dptools \
                +freeswitch-mod-console \
                +freeswitch-mod-dialplan-xml \
                +freeswitch-mod-dptools \
+               +freeswitch-mod-event-socket \
                +freeswitch-mod-local-stream \
                +freeswitch-mod-sndfile \
                +freeswitch-mod-sofia \
                +freeswitch-mod-tone-stream \
                +freeswitch-mod-voipcodecs \
                +freeswitch-mod-local-stream \
                +freeswitch-mod-sndfile \
                +freeswitch-mod-sofia \
                +freeswitch-mod-tone-stream \
                +freeswitch-mod-voipcodecs \
-               +freeswitch-mod-lua
+               +freeswitch-mod-lua \
+               +freeswitch-tools
 endef
 
 define Package/freeswitch-sounds-en
 endef
 
 define Package/freeswitch-sounds-en
index 11950568d060cfc7dbad20157692b0e1f6787c37..a155724dacf32d14087475cc0cfb0ac0a7920f83 100644 (file)
@@ -22,3 +22,16 @@ stop() {
        [ -f $DEFAULT ] && . $DEFAULT
        $FS_DIR/usr/bin/freeswitch $OPTIONS -stop
 }
        [ -f $DEFAULT ] && . $DEFAULT
        $FS_DIR/usr/bin/freeswitch $OPTIONS -stop
 }
+
+restart() {
+       # stopping freeswitch is non-blocking, so we wait until freeswitch's 
+       # event socket is down, and then wait an additional ten seconds so that 
+       # freeswitch should be completely shutdown before we start it again
+       local retval
+       stop
+       fs_cli -x status >/dev/null 2>&1
+       retval=$?
+       while [ $retval -eq 0 ]; do sleep 1; fs_cli -x status >/dev/null 2>&1; retval=$?; done
+       sleep 10
+       start
+}