net/asterisk13: sync with upstream

Taken from: HardenedBSD
This commit is contained in:
Franco Fichtner 2017-08-23 15:20:43 +02:00
parent 3755825224
commit afb9b2b61a
2 changed files with 19 additions and 2 deletions

View file

@ -2,6 +2,7 @@
PORTNAME= asterisk
PORTVERSION= 13.17.0
PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://downloads.asterisk.org/pub/telephony/%SUBDIR%/:DEFAULT,g729
MASTER_SITE_SUBDIR= asterisk/ \

View file

@ -17,6 +17,8 @@
# Default is "-n"
# asterisk_pidfile (string): Location of the asterisk pid file
# Default is /var/run/asterisk/asterisk.pid
# asterisk_stopsleep (int): Number of seconds to sleep before sending stop command
# Default is 0, which disables it
#
. /etc/rc.subr
@ -31,6 +33,7 @@ load_rc_config $name
: ${asterisk_user:=%%ASTERISK_USER%%}
: ${asterisk_args=-n}
: ${asterisk_pidfile:=/var/run/asterisk/asterisk.pid}
: ${asterisk_stopsleep:=0}
extra_commands=reload
@ -52,13 +55,26 @@ asterisk_precmd()
asterisk_stop()
{
echo 'Stopping asterisk'
if [ -z "$rc_pid" ]; then
[ -n "$rc_fast" ] && return 0
_run_rc_notrunning
return 1
fi
echo 'Stopping asterisk.'
if [ ${asterisk_stopsleep} > 0 ]; then
sleep ${asterisk_stopsleep}
fi
$command -nqrx 'core stop now'
wait_for_pids $rc_pid
}
asterisk_reload()
{
echo 'Reloading asterisk'
if [ -z "$rc_pid" ]; then
_run_rc_notrunning
return 1
fi
echo 'Reloading asterisk.'
$command -nqrx 'reload'
}