Merge "Add reload support to Asterisk"

This commit is contained in:
Jenkins 2013-08-11 16:44:24 +00:00 committed by Gerrit Code Review
commit cd172ae22c
53 changed files with 479 additions and 3 deletions

View File

@ -0,0 +1,141 @@
; File: modules.conf
; Description:
; Note: Do NOT edit this file.
; See http://wiki.kickstand-project.org/wiki/Asterisk:Configuration_Files for
; more information about using these configuration files.
[modules]
; Value: autoload
; Section: modules
; Description:
; Default: no
autoload = no
; Applications
load => app_authenticate.so
load => app_chanisavail.so
load => app_chanspy.so
load => app_dial.so
load => app_directory.so
load => app_echo.so
load => app_exec.so
load => app_macro.so
load => app_originate.so
load => app_playback.so
load => app_playtones.so
load => app_queue.so
load => app_read.so
load => app_record.so
load => app_sayunixtime.so
load => app_senddtmf.so
load => app_setcallerid.so
load => app_softhangup.so
load => app_stack.so
load => app_system.so
load => app_transfer.so
load => app_userevent.so
load => app_verbose.so
load => app_while.so
; Bridge
load => bridge_builtin_features.so
load => bridge_multiplexed.so
load => bridge_simple.so
load => bridge_softmix.so
; CDR
; CEL
; Channels
load => chan_local.so
load => chan_sip.so
; Codec
load => codec_adpcm.so
load => codec_alaw.so
load => codec_a_mu.so
load => codec_g722.so
load => codec_g726.so
load => codec_gsm.so
load => codec_lpc10.so
load => codec_speex.so
load => codec_ulaw.so
; Formats
load => format_g719.so
load => format_g723.so
load => format_g726.so
load => format_g729.so
load => format_gsm.so
load => format_h263.so
load => format_h264.so
load => format_ilbc.so
load => format_jpeg.so
load => format_pcm.so
load => format_siren14.so
load => format_siren7.so
load => format_sln16.so
load => format_sln.so
load => format_vox.so
load => format_wav_gsm.so
load => format_wav.so
; Functions
load => func_aes.so
load => func_audiohookinherit.so
load => func_base64.so
load => func_blacklist.so
load => func_callcompletion.so
load => func_callerid.so
load => func_cdr.so
load => func_channel.so
load => func_config.so
load => func_curl.so
load => func_cut.so
load => func_db.so
load => func_devstate.so
load => func_dialgroup.so
load => func_dialplan.so
load => func_enum.so
load => func_env.so
load => func_extstate.so
load => func_frame_trace.so
load => func_global.so
load => func_groupcount.so
load => func_iconv.so
load => func_lock.so
load => func_logic.so
load => func_math.so
load => func_md5.so
load => func_module.so
load => func_pitchshift.so
load => func_rand.so
load => func_realtime.so
load => func_sha1.so
load => func_shell.so
load => func_speex.so
load => func_sprintf.so
load => func_srv.so
load => func_strings.so
load => func_timeout.so
load => func_uri.so
load => func_version.so
load => func_vmcount.so
load => func_volume.so
; PBX
load => pbx_config.so
load => pbx_loopback
; Resource
load => res_agi.so
load => res_crypto.so
load => res_curl.so
load => res_monitor.so
load => res_musiconhold.so
load => res_rtp_asterisk.so
load => res_security_log.so
load => res_timing_timerfd.so
#tryinclude "modules.conf.d/*.conf"

View File

@ -0,0 +1,47 @@
# == Define: asterisk::function::customdir
#
# This class manages the asterisk server
#
# === Examples
#
# asterisk::function::customdir { 'cdr.conf': }
#
# === Authors
#
# Paul Belanger <paul.belanger@polybeacon.com>
#
# === Copyright
#
# Copyright (C) 2012, PolyBeacon, Inc.
#
# This program is free software, distributed under the terms
# of the Apache License, Version 2.0. See the LICENSE file at
# the top of the source tree.
#
define asterisk::function::customdir(
) {
include asterisk
File {
group => 'asterisk',
mode => '0640',
owner => 'asterisk',
}
$basedir = '/etc/asterisk'
$base = "${basedir}/${name}.d"
file { $base:
ensure => directory,
force => true,
notify => Exec["asterisk-module-reload-${name}"],
purge => true,
recurse => true,
require => [
File[$basedir],
Service['asterisk'],
]
}
}
# vim:sw=2:ts=2:expandtab

View File

@ -23,6 +23,8 @@ class asterisk (
$asterisk_conf_source = '',
$modules_conf_source = '',
) {
include asterisk::server::command
yumrepo { 'asteriskcurrent':
baseurl => 'http://packages.asterisk.org/centos/$releasever/current/$basearch/',
descr => 'Asterisk supporting packages produced by Digium',
@ -69,7 +71,7 @@ class asterisk (
require => Yumrepo['asteriskcurrent'],
}
file {'/etc/asterisk/asterisk.conf':
file { '/etc/asterisk/asterisk.conf':
ensure => present,
owner => 'asterisk',
group => 'asterisk',
@ -77,7 +79,7 @@ class asterisk (
source => $asterisk_conf_source,
}
file {'/etc/asterisk/modules.conf':
file { '/etc/asterisk/modules.conf.d/modules.conf':
ensure => present,
owner => 'asterisk',
group => 'asterisk',
@ -85,9 +87,10 @@ class asterisk (
source => $modules_conf_source,
}
file {'/etc/asterisk/':
file { '/etc/asterisk':
ensure => present,
recurse => true,
purge => true,
owner => 'asterisk',
group => 'asterisk',
mode => '0660',
@ -95,6 +98,24 @@ class asterisk (
require => Package['asterisk'],
}
$files = [
'ais.conf', 'amd.conf', 'asterisk.conf', 'calendar.conf', 'ccss.conf',
'cdr_adaptive_odbc.conf', 'cdr.conf', 'cdr_custom.conf',
'cdr_manager.conf', 'cdr_syslog.conf', 'cel.conf', 'cel_custom.conf',
'cel_odbc.conf', 'chan_dahdi.conf', 'cli.conf', 'cli_permissions.conf',
'codecs.conf', 'dnsmgr.conf', 'dsp.conf', 'dundi.conf', 'enum.conf',
'extconfig.conf', 'extensions.conf', 'features.conf', 'func_odbc.conf',
'gtalk.conf', 'http.conf', 'iax.conf', 'iaxprov.conf',
'indications.conf', 'jabber.conf', 'logger.conf', 'manager.conf',
'meetme.conf', 'modules.conf', 'musiconhold.conf', 'queuerules.conf',
'queues.conf', 'res_curl.conf', 'res_fax.conf', 'res_ldap.conf',
'res_odbc.conf', 'res_stun_monitor.conf', 'rtp.conf', 'say.conf',
'sip.conf', 'sip_notify.conf', 'smdi.conf', 'udptl.conf',
'voicemail.conf',
]
asterisk::function::customdir { $files: }
service { 'asterisk':
ensure => running,
enable => true,

View File

@ -0,0 +1,267 @@
# == Class: asterisk::server::command
#
# === Authors
#
# Paul Belanger <paul.belanger@polybeacon.com>
#
# === Copyright
#
# Copyright (C) 2012, PolyBeacon, Inc.
#
# This program is free software, distributed under the terms
# of the Apache License, Version 2.0. See the LICENSE file at
# the top of the source tree.
#
class asterisk::server::command {
exec { 'asterisk-module-reload-ais.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-amd.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-asterisk.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-calendar.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-ccss.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-cdr_adaptive_odbc.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-cdr.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-cdr_custom.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-cdr_manager.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-cdr_syslog.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-cel.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-cel_custom.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-cel_odbc.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-chan_dahdi.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-cli.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-cli_permissions.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-codecs.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-dnsmgr.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-dsp.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-dundi.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-enum.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-extconfig.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-extensions.conf':
command => '/usr/sbin/asterisk -rx "dialplan reload"',
refreshonly => true,
}
exec { 'asterisk-module-reload-features.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-func_odbc.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-gtalk.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-http.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-iax.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-iaxprov.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-indications.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-jabber.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-logger.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-manager.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-meetme.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-modules.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-musiconhold.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-queuerules.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-queues.conf':
command => '/usr/sbin/asterisk -rx "module reload app_queue.so"',
refreshonly => true,
}
exec { 'asterisk-module-reload-res_curl.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-res_fax.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-res_ldap.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-res_odbc.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-res_stun_monitor.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-rtp.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-say.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-sip.conf':
command => '/usr/sbin/asterisk -rx "module reload chan_sip.so"',
refreshonly => true,
}
exec { 'asterisk-module-reload-sip_notify.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-smdi.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-udptl.conf':
command => '/bin/true',
refreshonly => true,
}
exec { 'asterisk-module-reload-voicemail.conf':
command => '/usr/sbin/asterisk -rx "module reload app_voicemail.so"',
refreshonly => true,
}
}
# vim:sw=2:ts=2:expandtab