From 8e88edce0a6a107723a005e48e696213d20b0a22 Mon Sep 17 00:00:00 2001 From: Ciaby Date: Tue, 15 Jul 2014 15:33:11 -0500 Subject: [PATCH] Added LCR. --- .../files/usr/etc/lcr/interface.conf | 17 +++ .../files/usr/etc/lcr/options.conf | 111 ++++++++++++++++++ .../files/usr/etc/lcr/routing.conf | 13 ++ .../rhizomatica_base_system/manifests/init.pp | 21 +++- 4 files changed, 159 insertions(+), 3 deletions(-) create mode 100644 modules/rhizomatica_base_system/files/usr/etc/lcr/interface.conf create mode 100644 modules/rhizomatica_base_system/files/usr/etc/lcr/options.conf create mode 100644 modules/rhizomatica_base_system/files/usr/etc/lcr/routing.conf diff --git a/modules/rhizomatica_base_system/files/usr/etc/lcr/interface.conf b/modules/rhizomatica_base_system/files/usr/etc/lcr/interface.conf new file mode 100644 index 0000000..7177508 --- /dev/null +++ b/modules/rhizomatica_base_system/files/usr/etc/lcr/interface.conf @@ -0,0 +1,17 @@ +[gsm] +gsm-bs +tones yes +earlyb no +# These two lines enable RTP bridging +#bridge Ext +#rtp-bridge + +[Ext] +#sip [:] [:] +sip 127.0.0.1:5050 127.0.0.1:5060 +earlyb yes +tones yes +extern +# These two lines enable RTP bridging +#bridge gsm +#rtp-bridge diff --git a/modules/rhizomatica_base_system/files/usr/etc/lcr/options.conf b/modules/rhizomatica_base_system/files/usr/etc/lcr/options.conf new file mode 100644 index 0000000..188bc95 --- /dev/null +++ b/modules/rhizomatica_base_system/files/usr/etc/lcr/options.conf @@ -0,0 +1,111 @@ +# LCR options +############# + +# Turn debugging all on=0xffff or off=0x0000 (default= 0x0000) +# Note that debugging is for developer only. If you wan't to 'see the LCR +# working', you will find a logging feature below. Also detailed traces +# are possible using the admin tool. +#define DEBUG_CONFIG 0x0001 +#define DEBUG_MSG 0x0002 +#define DEBUG_STACK 0x0004 +#define DEBUG_BCHANNEL 0x0008 +#define DEBUG_PORT 0x0100 +#define DEBUG_ISDN 0x0110 +#define DEBUG_GSM 0x0120 +#define DEBUG_SS5 0x0140 +#define DEBUG_VBOX 0x0180 +#define DEBUG_SIP 0x10000 +#define DEBUG_EPOINT 0x0200 +#define DEBUG_JOIN 0x0400 +#define DEBUG_CRYPT 0x1000 +#define DEBUG_ROUTE 0x2000 +#define DEBUG_IDLETIME 0x4000 +#define DEBUG_LOG 0x7fffff + +#debug 0x0000 + +# The log file can be used to track actions by the LCR. Omit the parameter +# to turn off log file. By default, log file is located inside the directory +# "/usr/local/lcr/log". +#log /usr/local/lcr/log + +# Use "alaw" (default) or "ulaw" samples. +alaw + +# The LCR should run as real time process. Because audio is streamed and +# ISDN protocol requires a certain response time, we must have high priority. +# By default, the process runs an normal priority, lika most processes do. +# To debug, it is whise to use "schedule" with no parameter to turn off +# realtime scheduling. In case of an endless loop bug, LCR will take +# all CPU time forever - your machine hangs. +#schedule 0 + +# Use tone sets (default= tones_american). +# Tones/announcements are streamed from user space. It is possible to use +# the module "mISDN_dsp.o" instead. It provides simple tones with much less cpu +# usage. If supported by special hardware, tones are loops that require no +# bus/cpu load at all, except when the tone changes. +# Use parameter "american", "german", or "oldgerman". "oldgerman" sounds like +# the old german telephone system used until end of year 1998. +# This can be overridden by the the tones_dir in the interface.conf. +# Both options.conf and interface.conf can be overridden by extension setting. +#tones_dir tones_american + +# Fetch tone sets as specified here. +# The tone sets will be loaded during startup, and no harddisk access is +# required. Specify all tone sets seperated by komma. +# By default, no tone is fetched. Tone sets, that are not specified here, will +# be streamed from hard disk. +# Don't use spaces to seperate! +#fetch_tones tones_american,tones_german,vbox_english,vbox_german + +# Prefix to dial national call (default= 0). +# If you omit the prefix, all subscriber numbers are national numbers. +# (example: Danmark) +#national 0 + +# Prefix to dial international call (default= 00). +# If you omit the prefix, all subscriber numbers are international numbers. +#international 00 + +# On external calls, dialing can be done via normal called party number +# information element or via keypad facility. Some telephone systems require +# dialing via keypad to enable/disable special functions. +# By default keypad facility is disabled. +#keypad + +# For calls to external where caller id is not available, this id is used. +# It is sent of type "subscriber number". This ID is only usefull if the +# external line will not screen caller id. It will be sent anonymous. +# If you don't know what to use it for, you don't need it. +# Default is nothing. +#dummyid 0 + +# Source email address of the LCR. E.g. it is used when sending a mail +# from the voice box. It is not the address the mails are sent to. +# Most mail servers require an existing domain in order to accept mails. +#email lcr@your.domain + +# Directory to write lock file and admin socket file to. +# If /var/run does not have the rights to run LCR, you may choose /var/tmp +# or any directory with the appropiet rights LCR runs with. +#lock /var/run + +# Change rights of LCR socket, where lcradmin or chan_lcr connects to. +# By default 700 (user only) rights are set. If Asterisk runs with a different +# user, the rights may be changed to all users (777). +# Rights must have 0 in front, if octal values above are used. +#socketrights 0700 + +# Change user of LCR socket, where lcradmin or chan_lcr connects to. +# So: change to asterisk, if you have asterisk run as user "asterisk" e.g. +#socketuser asterisk + +# Change group of LCR socket, where lcradmin or chan_lcr connects to. +# So: change to asterisk, if you have asterisk run in group "asterisk" e.g. +#socketgroup asterisk + +# Enable polling in main loop. +# This feature is temporarily for test purpose. Don't enable it +#polling + diff --git a/modules/rhizomatica_base_system/files/usr/etc/lcr/routing.conf b/modules/rhizomatica_base_system/files/usr/etc/lcr/routing.conf new file mode 100644 index 0000000..44a5c5c --- /dev/null +++ b/modules/rhizomatica_base_system/files/usr/etc/lcr/routing.conf @@ -0,0 +1,13 @@ +# Linux-Call-Router routing configuration "routing.conf" + + +[main] +interface=gsm : goto ruleset=intern +extern : goto ruleset=extern +intern : goto ruleset=intern + : disconnect cause=31 +[extern] + : extern interfaces=gsm + +[intern] + : extern interfaces=Ext diff --git a/modules/rhizomatica_base_system/manifests/init.pp b/modules/rhizomatica_base_system/manifests/init.pp index b761757..fdbbf81 100644 --- a/modules/rhizomatica_base_system/manifests/init.pp +++ b/modules/rhizomatica_base_system/manifests/init.pp @@ -228,9 +228,10 @@ class rhizomatica_base_system { file { '/usr/lib/freeswitch/mod/mod_g729.so': source => 'puppet:///modules/rhizomatica_base_system/mod_g729.so', require => Package['freeswitch'], - } + } file { '/etc/freeswitch': + ensure => directory, source => 'puppet:///modules/rhizomatica_base_system/etc/freeswitch', recurse => remote, require => Package['freeswitch'], @@ -239,11 +240,11 @@ class rhizomatica_base_system { file { '/etc/freeswitch/vars.xml': content => template('rhizomatica_base_system/vars.xml.erb'), require => Package['freeswitch'], - } + } file {'/etc/freeswitch/sip_profiles/external': ensure => directory, - } + } file { '/etc/freeswitch/sip_profiles/external/provider.xml': content => template('rhizomatica_base_system/provider.xml.erb'), @@ -261,6 +262,20 @@ class rhizomatica_base_system { require => Package['osmocom-nitb'], } +#LCR + package { 'lcr': + ensure => installed, + require => Apt::Source['rhizomatica'], + } + + file { '/usr/etc/lcr': + ensure => directory, + source => 'puppet:///modules/rhizomatica_base_system/usr/etc/lcr', + recurse => remote, + purge => true, + require Package['lcr'], + } + file { '/etc/cron.d/rhizomatica': source => 'puppet:///modules/rhizomatica_base_system/etc/cron.d/rhizomatica', }