From dd33165099379ce339fc9487e0b5e17c9d9185dd Mon Sep 17 00:00:00 2001 From: Ciaby Date: Sat, 12 Sep 2015 14:43:29 +0200 Subject: [PATCH 01/15] Introduce a timeout for RHS and RRC cron jobs --- modules/rhizo_base/files/etc/cron.d/rhizomatica | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rhizo_base/files/etc/cron.d/rhizomatica b/modules/rhizo_base/files/etc/cron.d/rhizomatica index 3e8b7d3..698e684 100644 --- a/modules/rhizo_base/files/etc/cron.d/rhizomatica +++ b/modules/rhizo_base/files/etc/cron.d/rhizomatica @@ -22,7 +22,7 @@ PYTHONPATH=$PYTHONPATH:/var/rhizomatica/rccn # */10 * * * * root /home/rhizomatica/bin/bind_check.sh #Roaming jobs -*/30 * * * * root /usr/bin/python /var/rhizomatica/rccn/rrc.py > /dev/null 2>&1 ; /usr/bin/python /var/rhizomatica/rccn/rhs.py > /dev/null 2>&1 +*/30 * * * * root timeout 10m /usr/bin/python /var/rhizomatica/rccn/rrc.py > /dev/null 2>&1 ; timeout 15m /usr/bin/python /var/rhizomatica/rccn/rhs.py > /dev/null 2>&1 #Cleanup inactive users 0 5 * * * root /usr/bin/python /var/rhizomatica/rccn/rip.py > /dev/null 2>&1 From 69401f3e7b68bbce098fc77d345587e5d96239b5 Mon Sep 17 00:00:00 2001 From: Ciaby Date: Mon, 24 Aug 2015 17:12:30 +0200 Subject: [PATCH 02/15] RTP-bridge support Change config files for FreeSWITCH, LCR and OpenBSC --- .../files/etc/freeswitch/sip_profiles/internal.xml | 4 ++-- modules/rhizo_base/files/usr/etc/lcr/interface.conf | 10 +++++----- modules/rhizo_base/templates/osmo-nitb.cfg.erb | 8 ++++++++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/modules/rhizo_base/files/etc/freeswitch/sip_profiles/internal.xml b/modules/rhizo_base/files/etc/freeswitch/sip_profiles/internal.xml index c7e3d60..5297d5c 100644 --- a/modules/rhizo_base/files/etc/freeswitch/sip_profiles/internal.xml +++ b/modules/rhizo_base/files/etc/freeswitch/sip_profiles/internal.xml @@ -91,9 +91,9 @@ - + - + diff --git a/modules/rhizo_base/files/usr/etc/lcr/interface.conf b/modules/rhizo_base/files/usr/etc/lcr/interface.conf index 7177508..d306df2 100644 --- a/modules/rhizo_base/files/usr/etc/lcr/interface.conf +++ b/modules/rhizo_base/files/usr/etc/lcr/interface.conf @@ -3,15 +3,15 @@ gsm-bs tones yes earlyb no # These two lines enable RTP bridging -#bridge Ext -#rtp-bridge +bridge Ext +rtp-bridge [Ext] #sip [:] [:] -sip 127.0.0.1:5050 127.0.0.1:5060 +sip 172.16.0.1:5050 172.16.0.1:5060 earlyb yes tones yes extern # These two lines enable RTP bridging -#bridge gsm -#rtp-bridge +bridge gsm +rtp-bridge diff --git a/modules/rhizo_base/templates/osmo-nitb.cfg.erb b/modules/rhizo_base/templates/osmo-nitb.cfg.erb index 3139405..d9e0031 100644 --- a/modules/rhizo_base/templates/osmo-nitb.cfg.erb +++ b/modules/rhizo_base/templates/osmo-nitb.cfg.erb @@ -6,6 +6,7 @@ password foo log stderr logging filter all 1 logging color 1 + logging print category 0 logging timestamp 0 logging level all notice logging level rll notice @@ -31,6 +32,7 @@ log stderr logging level nat notice logging level ctrl notice logging level smpp notice + logging level filter notice logging level lglobal notice logging level llapd notice logging level linp notice @@ -38,6 +40,8 @@ log stderr logging level lmi notice logging level lmib notice logging level lsms notice + logging level lctrl notice + logging level lgtp notice ! line vty no login @@ -404,9 +408,13 @@ network mncc-int default-codec tch-f fr default-codec tch-h hr +nitb + subscriber-create-on-demand + no assign-tmsi smpp local-tcp-port 2775 policy closed + smpp-first esme OSMPP password <%= @smsc_password %> default-route From 088312093159047c81846fa78eaac80bdceb0d2f Mon Sep 17 00:00:00 2001 From: Ciaby Date: Mon, 24 Aug 2015 17:56:09 +0200 Subject: [PATCH 03/15] Change RCCN version to 1.0.5-rtp --- modules/rhizo_base/manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rhizo_base/manifests/init.pp b/modules/rhizo_base/manifests/init.pp index 796bbdc..0f359e1 100644 --- a/modules/rhizo_base/manifests/init.pp +++ b/modules/rhizo_base/manifests/init.pp @@ -154,7 +154,7 @@ class rhizo_base { ensure => present, provider => git, source => 'https://github.com/Rhizomatica/rccn.git', - revision => '1.0.5', + revision => '1.0.5-rtp', require => [ File['/var/rhizomatica'], Package['git'] ], notify => [ Exec['locale-gen'], Exec['restart-freeswitch'], From a08da68bcc47b85148e4dd38f1521067fb655cc2 Mon Sep 17 00:00:00 2001 From: Ciaby Date: Thu, 27 Aug 2015 19:24:20 +0200 Subject: [PATCH 04/15] Force ext-sip-ip and ext-rtp-ip to 172.16.0.1 --- .../rhizo_base/files/etc/freeswitch/sip_profiles/internal.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/rhizo_base/files/etc/freeswitch/sip_profiles/internal.xml b/modules/rhizo_base/files/etc/freeswitch/sip_profiles/internal.xml index 5297d5c..cc9b98d 100644 --- a/modules/rhizo_base/files/etc/freeswitch/sip_profiles/internal.xml +++ b/modules/rhizo_base/files/etc/freeswitch/sip_profiles/internal.xml @@ -272,8 +272,8 @@ auto - Use guessed ip. auto-nat - Use ip learned from NAT-PMP or UPNP --> - - + + From ebb90bd80afa54d3914b5276e316cd7da0c2e25d Mon Sep 17 00:00:00 2001 From: Ciaby Date: Fri, 18 Sep 2015 22:57:49 +0200 Subject: [PATCH 05/15] Be more specific about OpenBSC and related packages. --- modules/rhizo_base/manifests/openbsc.pp | 38 +++++++++++++++++++++---- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/modules/rhizo_base/manifests/openbsc.pp b/modules/rhizo_base/manifests/openbsc.pp index 09803a1..ea2bfd4 100644 --- a/modules/rhizo_base/manifests/openbsc.pp +++ b/modules/rhizo_base/manifests/openbsc.pp @@ -24,16 +24,35 @@ class rhizo_base::openbsc { $bts3_ip_address = $rhizo_base::bts3_ip_address $smsc_password = $rhizo_base::smsc_password - package { ['osmocom-nitb', 'osmocom-nitb-dbg', - 'libdbd-sqlite3', 'libsmpp0']: - ensure => installed, - require => Class['rhizo_base::apt'], - notify => Exec['hlr_pragma_wal'], + package { [ 'libosmoabis4', 'libosmocore6', + 'libosmoctrl0', 'libosmogsm5', + 'libosmovty1', 'osmocom-nitb', + 'osmocom-nitb-dbg']: + ensure => latest, + require => Class['rhizo_base::apt'], + notify => [ Exec['hlr_pragma_wal'], + Exec['restart-nitb'] ], } + package { [ 'libosmoabis3', 'libosmocore4', + 'libosmogsm6', 'libosmovty0', + 'libgtp', 'libgtp0', + 'libgtp0-dev', 'openggsn', + 'libosmo-abis', 'libosmo-abis-dbg', + 'libosmo-abis-dev', 'libosmo-netif-dbg', + 'libosmo-netif-dev', 'libosmo-sccp', + 'libosmo-sccp-dbg', 'libosmo-sccp-dev', + 'libosmocodec0', 'libosmocore', + 'libosmocore-dbg', 'libosmocore-dev', + 'libosmocore-utils', 'libosmogb3', + 'libosmonetif2', 'libosmosim0', + 'libosmotrau0']: + ensure => absent, + } + service { 'osmocom-nitb': enable => false, - require => Package['osmocom-nitb'] + require => Package['osmocom-nitb'], } file { '/etc/osmocom/osmo-nitb.cfg': @@ -47,4 +66,11 @@ class rhizo_base::openbsc { require => Class['rhizo_base::packages'], refreshonly => true, } + + exec { 'restart-nitb': + command => '/usr/bin/sv restart osmo-nitb', + require => Class['rhizo_base::packages'], + refreshonly => true, + } + } From ca482fc86e65960e1f51c886da65dcc15e28413c Mon Sep 17 00:00:00 2001 From: Ciaby Date: Fri, 18 Sep 2015 23:08:05 +0200 Subject: [PATCH 06/15] Ensure that the machine is running the latest version of LCR. --- modules/rhizo_base/manifests/lcr.pp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/rhizo_base/manifests/lcr.pp b/modules/rhizo_base/manifests/lcr.pp index db88b22..75ce725 100644 --- a/modules/rhizo_base/manifests/lcr.pp +++ b/modules/rhizo_base/manifests/lcr.pp @@ -12,8 +12,14 @@ # class rhizo_base::lcr { package { 'lcr': - ensure => installed, + ensure => latest, require => Class['rhizo_base::apt'], + notify => Exec['restart-lcr'], + } + + exec { 'restart-lcr': + command => '/usr/bin/sv restart lcr', + refreshonly => true, } service { 'lcr': From 3c2ea9fff31df634dfe66b4bc2112ad74a487057 Mon Sep 17 00:00:00 2001 From: Ciaby Date: Fri, 18 Sep 2015 23:13:53 +0200 Subject: [PATCH 07/15] Not only remove the old/unused packages, purge them too. --- modules/rhizo_base/manifests/openbsc.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rhizo_base/manifests/openbsc.pp b/modules/rhizo_base/manifests/openbsc.pp index ea2bfd4..0613827 100644 --- a/modules/rhizo_base/manifests/openbsc.pp +++ b/modules/rhizo_base/manifests/openbsc.pp @@ -47,7 +47,7 @@ class rhizo_base::openbsc { 'libosmocore-utils', 'libosmogb3', 'libosmonetif2', 'libosmosim0', 'libosmotrau0']: - ensure => absent, + ensure => purged, } service { 'osmocom-nitb': From 4476f80c7dec9642035a1740e2725f137e838b16 Mon Sep 17 00:00:00 2001 From: Ciaby Date: Fri, 18 Sep 2015 23:25:53 +0200 Subject: [PATCH 08/15] Fix the runit script for LCR --- modules/rhizo_base/files/etc/sv/lcr/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rhizo_base/files/etc/sv/lcr/run b/modules/rhizo_base/files/etc/sv/lcr/run index 22652f1..7d62587 100755 --- a/modules/rhizo_base/files/etc/sv/lcr/run +++ b/modules/rhizo_base/files/etc/sv/lcr/run @@ -1,2 +1,2 @@ #!/bin/sh -/usr/sbin/lcr start +exec /usr/sbin/lcr start From 60213eee5ad2c3c4f4cfb51d932aa391235c4313 Mon Sep 17 00:00:00 2001 From: Ciaby Date: Sat, 19 Sep 2015 00:08:03 +0200 Subject: [PATCH 09/15] Upgrade python module to 1.9.5 --- modules/python | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/python b/modules/python index 0996770..eb52429 160000 --- a/modules/python +++ b/modules/python @@ -1 +1 @@ -Subproject commit 09967704c152f5fd044ed4ddbc7382ef2e24aea5 +Subproject commit eb52429dbf78778a4871169571a744bff44a6287 From fd600bcd9014cd9740f9e68ae9ae75a9baac1d43 Mon Sep 17 00:00:00 2001 From: Ciaby Date: Thu, 24 Sep 2015 20:41:47 +0200 Subject: [PATCH 10/15] Change RCCN version to 1.0.6 --- modules/rhizo_base/manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rhizo_base/manifests/init.pp b/modules/rhizo_base/manifests/init.pp index 0f359e1..5aec3f5 100644 --- a/modules/rhizo_base/manifests/init.pp +++ b/modules/rhizo_base/manifests/init.pp @@ -154,7 +154,7 @@ class rhizo_base { ensure => present, provider => git, source => 'https://github.com/Rhizomatica/rccn.git', - revision => '1.0.5-rtp', + revision => '1.0.6', require => [ File['/var/rhizomatica'], Package['git'] ], notify => [ Exec['locale-gen'], Exec['restart-freeswitch'], From 3b8290d62573a09251ab359b199565e3321ba0c6 Mon Sep 17 00:00:00 2001 From: Ciaby Date: Tue, 29 Sep 2015 21:41:45 +0200 Subject: [PATCH 11/15] Add rhizo::lac and rhizo::voip_pin to site_template.yaml --- hieradata/site_template.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hieradata/site_template.yaml b/hieradata/site_template.yaml index 39d00a8..2a6b92f 100644 --- a/hieradata/site_template.yaml +++ b/hieradata/site_template.yaml @@ -9,6 +9,7 @@ rhizo::arfcn_B: "251" rhizo::auth_policy: "accept-all" rhizo::vpn_ip_address: "10.66.0.0" rhizo::wan_ip_address: "192.168.0.0" +rhizo::lac: "1" #Emergency call contact rhizo::emergency_contact: "12345" @@ -18,6 +19,7 @@ rhizo::voip_provider_name: "provider" rhizo::voip_username: "1234567890" rhizo::voip_fromuser: "1234567890" rhizo::voip_password: "1234" +rhizo::voip_pin: "1234" rhizo::voip_proxy: "10.10.10.10" rhizo::voip_did: "12345678901" rhizo::voip_cli: "12345678901" From 9a53c840e21730559dddffc9e051f81d8fd0f91f Mon Sep 17 00:00:00 2001 From: Ciaby Date: Tue, 29 Sep 2015 21:44:11 +0200 Subject: [PATCH 12/15] Restart osmo-nitb when osmo-nitb.cfg changes --- modules/rhizo_base/manifests/openbsc.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/rhizo_base/manifests/openbsc.pp b/modules/rhizo_base/manifests/openbsc.pp index 0613827..996e13a 100644 --- a/modules/rhizo_base/manifests/openbsc.pp +++ b/modules/rhizo_base/manifests/openbsc.pp @@ -58,6 +58,7 @@ class rhizo_base::openbsc { file { '/etc/osmocom/osmo-nitb.cfg': content => template('rhizo_base/osmo-nitb.cfg.erb'), require => Package['osmocom-nitb'], + notify => Exec['restart-nitb'], } exec { 'hlr_pragma_wal': From ed80dc9e4850f9003a48f82fcb710dc68c52baed Mon Sep 17 00:00:00 2001 From: Ciaby Date: Tue, 29 Sep 2015 21:46:35 +0200 Subject: [PATCH 13/15] Import $lac from Hiera --- modules/rhizo_base/manifests/init.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/rhizo_base/manifests/init.pp b/modules/rhizo_base/manifests/init.pp index 5aec3f5..0e7dc8f 100644 --- a/modules/rhizo_base/manifests/init.pp +++ b/modules/rhizo_base/manifests/init.pp @@ -34,6 +34,7 @@ class rhizo_base { # network name $network_name = hiera('rhizo::network_name') $auth_policy = hiera('rhizo::auth_policy') + $lac = hiera('rhizo::lac') #BTSs configuration $bts1_ip_address = hiera('rhizo::bts1_ip_address') From 287c9a63272fa583e99be0fdd2192ff8a5f9e9aa Mon Sep 17 00:00:00 2001 From: Ciaby Date: Tue, 29 Sep 2015 21:48:31 +0200 Subject: [PATCH 14/15] Import $lac into openbsc.pp --- modules/rhizo_base/manifests/openbsc.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/rhizo_base/manifests/openbsc.pp b/modules/rhizo_base/manifests/openbsc.pp index 996e13a..32e63b2 100644 --- a/modules/rhizo_base/manifests/openbsc.pp +++ b/modules/rhizo_base/manifests/openbsc.pp @@ -13,6 +13,7 @@ class rhizo_base::openbsc { $network_name = $rhizo_base::network_name $auth_policy = $rhizo_base::auth_policy + $lac = $rhizo_base::lac $max_power_red = $rhizo_base::max_power_red $arfcn_A = $rhizo_base::arfcn_A $arfcn_B = $rhizo_base::arfcn_B From f7842ca5c4b09c21dbc01ec921ce31ab479fbe3e Mon Sep 17 00:00:00 2001 From: Ciaby Date: Tue, 29 Sep 2015 21:55:35 +0200 Subject: [PATCH 15/15] Make location_are_code in osmo-nitb.cfg configurable (using $lac) --- modules/rhizo_base/templates/osmo-nitb.cfg.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/rhizo_base/templates/osmo-nitb.cfg.erb b/modules/rhizo_base/templates/osmo-nitb.cfg.erb index d9e0031..60273d3 100644 --- a/modules/rhizo_base/templates/osmo-nitb.cfg.erb +++ b/modules/rhizo_base/templates/osmo-nitb.cfg.erb @@ -87,7 +87,7 @@ network type sysmobts band GSM850 cell_identity 0 - location_area_code 1 + location_area_code <%= @lac %> base_station_id_code 63 ms max power 33 cell reselection hysteresis 14 @@ -140,7 +140,7 @@ network type sysmobts band GSM850 cell_identity 1 - location_area_code 1 + location_area_code <%= @lac %> base_station_id_code 63 ms max power 33 cell reselection hysteresis 14 @@ -194,7 +194,7 @@ network type sysmobts band GSM850 cell_identity 2 - location_area_code 1 + location_area_code <%= @lac %> base_station_id_code 63 ms max power 33 cell reselection hysteresis 14 @@ -247,7 +247,7 @@ network type sysmobts band GSM850 cell_identity 3 - location_area_code 1 + location_area_code <%= @lac %> base_station_id_code 63 ms max power 33 cell reselection hysteresis 14 @@ -302,7 +302,7 @@ network type sysmobts band GSM850 cell_identity 4 - location_area_code 1 + location_area_code <%= @lac %> base_station_id_code 63 ms max power 33 cell reselection hysteresis 14 @@ -355,7 +355,7 @@ network type sysmobts band GSM850 cell_identity 5 - location_area_code 1 + location_area_code <%= @lac %> base_station_id_code 63 ms max power 33 cell reselection hysteresis 14