Added missing configuration to guide

This commit is contained in:
Supreeth Herle 2019-09-15 15:04:34 +02:00
parent 0aae608c5c
commit 2d025bb0f2
1 changed files with 544 additions and 88 deletions

View File

@ -32,8 +32,7 @@ This removes all existing cloud users and allows only root user and sets a passw
```
$ apt update && apt upgrade -y && apt install -y mysql-server tcpdump screen ntp ntpdate git-core dkms gcc flex bison libmysqlclient-dev make \
libssl-dev libcurl4-openssl-dev libxml2-dev libpcre3-dev bash-completion g++ autoconf rtpproxy libmnl-dev \
libsctp-dev ipsec-tools
libssl-dev libcurl4-openssl-dev libxml2-dev libpcre3-dev bash-completion g++ autoconf rtpproxy libmnl-dev libsctp-dev ipsec-tools
```
#### 4. Install all required Kamailio packages (v5.2)
@ -44,47 +43,7 @@ $ add-apt-repository 'deb http://deb.kamailio.org/kamailio52 bionic main'
$ apt install -y kamailio kamailio-mysql-modules kamailio-ims-modules kamailio-presence-modules kamailio-tls-modules kamailio-xml-modules kamailio-xmlrpc-modules
```
#### 5. Create necessary folders for kamailio pid files and set ownership
Create the directory for pid file:
```
$ mkdir -p /var/run/kamailio
$ mkdir -p /var/run/kamailio_icscf
$ mkdir -p /var/run/kamailio_pcscf
$ mkdir -p /var/run/kamailio_scscf
```
Default setting is to run Kamailio as user kamailio and group kamailio. For that you need to create the user:
```
$ adduser --quiet --system --group --disabled-password \
--shell /bin/false --gecos "Kamailio" \
--home /var/run/kamailio kamailio
$ adduser --quiet --system --group --disabled-password \
--shell /bin/false --gecos "Kamailio" \
--home /var/run/kamailio_icscf kamailio
$ adduser --quiet --system --group --disabled-password \
--shell /bin/false --gecos "Kamailio" \
--home /var/run/kamailio_pcscf kamailio
$ adduser --quiet --system --group --disabled-password \
--shell /bin/false --gecos "Kamailio" \
--home /var/run/kamailio_scscf kamailio
```
Set ownership:
```
$ chown kamailio:kamailio /var/run/kamailio
$ chown kamailio:kamailio /var/run/kamailio_icscf
$ chown kamailio:kamailio /var/run/kamailio_pcscf
$ chown kamailio:kamailio /var/run/kamailio_scscf
```
#### 6. Clone Kamailio repository and checkout 5.2 version of repository
#### 5. Clone Kamailio repository and checkout 5.2 version of repository
```
$ mkdir -p /usr/local/src/kamailio-5.2
@ -94,39 +53,147 @@ $ cd kamailio
$ git checkout -b 5.2 origin/5.2
```
#### 7. Edit /etc/hosts file for hostname resolution
Edit the /etc/hosts file as follows:
In the below example ims-deb is the hostname of the machine, PCRF is running in 10.4.128.11/172.24.15.3 (Floating IP) machine and IMS running at 10.4.128.7/172.24.15.21 (Floating IP)
Notice the change in PCRF address resolution (It should be the machine IP where PCRF is running)
{: .notice--warning}
#### 6. Setup the DNS for resolving IMS components names
```
root@ims-deb:~# cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 ims-deb
10.4.128.7 hss.mnc096.mcc262.3gppnetwork.org mnc096.mcc262.3gppnetwork.org
10.4.128.7 icscf.mnc096.mcc262.3gppnetwork.org mnc096.mcc262.3gppnetwork.org
10.4.128.7 pcscf.mnc096.mcc262.3gppnetwork.org mnc096.mcc262.3gppnetwork.org
10.4.128.7 scscf.mnc096.mcc262.3gppnetwork.org mnc096.mcc262.3gppnetwork.org
172.24.15.3 pcrf.mnc096.mcc262.3gppnetwork.org mnc096.mcc262.3gppnetwork.org
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
$ apt install -y bind9
```
After editing the file, save it and reboot the machine
{: .notice--info}
Use the below example DNS Zone file to create a DNS Zone file in the /etc/bind folder and
edit /etc/bind/named.conf.local, /etc/bind/named.conf.options accordingly:
```
$ cd /etc/bind
$ vim mnc096.mcc262.3gppnetwork.org
```
#### 8. Populate MySQL database using kamctlrc command
In the below example: Kamailio IMS & DNS server running at 10.4.128.7/172.24.15.21 (Floating IP) and PCRF at 10.4.128.11/172.24.15.3 (Floating IP)
```
$ORIGIN mnc096.mcc262.3gppnetwork.org.
$TTL 1W
@ 1D IN SOA localhost. root.localhost. (
1 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
1D IN NS ns
ns 1D IN A 10.4.128.7
pcscf 1D IN A 10.4.128.7
_sip._udp.pcscf 1D SRV 0 0 5060 pcscf
_sip._tcp.pcscf 1D SRV 0 0 5060 pcscf
icscf 1D IN A 10.4.128.7
_sip._udp 1D SRV 0 0 4060 icscf
_sip._tcp 1D SRV 0 0 4060 icscf
_sip._udp.ims 1D SRV 0 0 4060 icscf
_sip._tcp.ims 1D SRV 0 0 4060 icscf
scscf 1D IN A 10.4.128.7
_sip._udp.scscf 1D SRV 0 0 6060 scscf
_sip._tcp.scscf 1D SRV 0 0 6060 scscf
hss 1D IN A 10.4.128.7
pcrf 1D IN A 10.4.128.11
```
Edit /etc/bind/named.conf.local file as follows:
```
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
zone "mnc096.mcc262.3gppnetwork.org" {
type master;
file "/etc/bind/mnc096.mcc262.3gppnetwork.org";
};
```
Edit /etc/bind/named.conf.options file as follows:
```
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
forwarders {
// Put here the IP address of other DNS server which could be used if name cannot be resolved with DNS server running in this machine
10.4.128.2;
};
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation no;
allow-query { localhost; };
auth-nxdomain no; # conform to RFC1035
//listen-on-v6 { any; };
};
```
```
$ systemctl restart bind9
```
Then, test DNS resolution by adding following entries on top of all other entries in /etc/resolv.conf.
search mnc096.mcc262.3gppnetwork.org
nameserver 10.4.128.7
Finally, ping to ensure
$ ping pcscf
PING pcscf.mnc096.mcc262.3gppnetwork.org (10.4.128.7) 56(84) bytes of data.
64 bytes from localhost (10.4.128.7): icmp_seq=1 ttl=64 time=0.017 ms
64 bytes from localhost (10.4.128.7): icmp_seq=2 ttl=64 time=0.041 ms
To make changes in /etc/resolv.conf be persistent across reboot edit the /etc/netplan/50-cloud-init.yaml file as follows:
```
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
ethernets:
ens3:
dhcp4: true
match:
macaddress: fa:16:3e:99:f5:67
set-name: ens3
nameservers:
search: [mnc096.mcc262.3gppnetwork.org]
addresses:
- 10.4.128.7
```
```
$ netplan apply
$ ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
$ systemctl restart systemd-resolved.service
```
#### 7. Populate MySQL database using kamctlrc command
Edit SIP_DOMAIN and DBENGINE in the /etc/kamailio/kamctlrc configuration file (Used by kamctl and kamdbctl tools).
@ -166,7 +233,7 @@ The kamdbctl will add two users in MySQL user tables:
- kamailioro - (with default password 'kamailioro') - user which has read-only access rights to 'kamailio' database
```
#### 9. Edit /etc/default/rtpproxy file as follows:
#### 8. Edit /etc/default/rtpproxy file as follows:
```
# Defaults for rtpproxy
@ -188,7 +255,7 @@ Then run,
$ systemctl restart rtpproxy
```
#### 10. Edit configuration file to fit your requirements for the VoIP platform, you have to edit the /etc/kamailio/kamailio.cfg configuration file
#### 9. Edit configuration file to fit your requirements for the VoIP platform, you have to edit the /etc/kamailio/kamailio.cfg configuration file
Follow the instruction in the comments to enable usage of MySQL. Basically you have to add several lines at the top of config file, like:
@ -212,13 +279,13 @@ modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:22222")
If you changed the password for the 'kamailio' user of MySQL, you have to update the value for 'DBURL' parameters.
#### 11. Run Kamailio SIP server
#### 10. Run Kamailio SIP server
```
$ systemctl start kamailio
```
#### 12. A quick check for the basic working of SIP server can be done as follows:
#### 11. A quick check for the basic working of SIP server can be done as follows:
Create new subscriber accounts. A new account can be added using `kamctl` tool via `kamctl add <username> <password>`
(When asked for entering MySQL password for user 'kamailio@localhost': type 'kamailiorw', as provided in kamailio.cfg)
@ -287,7 +354,7 @@ Save and exit
- Now try calling from either phone
#### 13. Create new mysql database for pcscf, scscf and icscf, populate databases and grant permissions to respective users identified by a password
#### 12. Create new mysql database for pcscf, scscf and icscf, populate databases and grant permissions to respective users identified by a password
```
$ mysql
@ -367,9 +434,24 @@ Verify that following tables are present in respective databases by logging into
<mysql> grant delete,insert,select,update on scscf.* to scscf@localhost identified by 'heslo';
<mysl> grant delete,insert,select,update on icscf.* to icscf@localhost identified by 'heslo';
<mysl> grant delete,insert,select,update on icscf.* to provisioning@localhost identified by 'provi';
<mysql> GRANT ALL PRIVILEGES ON pcscf.* TO 'pcscf'@'%' identified by 'heslo';
<mysql> GRANT ALL PRIVILEGES ON scscf.* TO 'scscf'@'%' identified by 'heslo';
<mysql> GRANT ALL PRIVILEGES ON icscf.* TO 'icscf'@'%' identified by 'heslo';
<mysql> GRANT ALL PRIVILEGES ON icscf.* TO 'provisioning'@'%' identified by 'provi';
<mysql> FLUSH PRIVILEGES;
```
#### 14. Copy pcscf, icscf and scscf configuration files to /etc/ folder and edit accordingly
Then,
```
$ mysql
<mysql> use icscf;
<mysql> INSERT INTO `nds_trusted_domains` VALUES (1,'mnc096.mcc262.3gppnetwork.org');
<mysql> INSERT INTO `s_cscf` VALUES (1,'First and only S-CSCF','sip:scscf.mnc096.mcc262.3gppnetwork.org:6060');
<mysql> INSERT INTO `s_cscf_capabilities` VALUES (1,1,0),(2,1,1);
```
#### 13. Copy pcscf, icscf and scscf configuration files to /etc/ folder and edit accordingly
```
$ cd /usr/local/src/kamailio-5.2/kamailio/misc/examples/ims/
@ -386,17 +468,23 @@ Edit the configuration files as per your deployment needs
### I-CSCF
Edit the DNS domain names, DB URL and IP addresses at all places in the icscf.cfg, icscf.xml files accordingly
Changes required in icscf.cfg:
```
# SIP / UDP
listen=udp:10.4.128.7:4060
# SIP / TCP
listen=tcp:10.4.128.7:4060
alias=icscf.mnc096.mcc262.3gppnetwork.org
#!define NETWORKNAME "mnc096.mcc262.3gppnetwork.org"
#!define HOSTNAME "icscf.mnc096.mcc262.3gppnetwork.org"
#!define ENUM_SUFFIX "mnc096.mcc262.3gppnetwork.org."
#!define DB_URL "mysql://icscf:heslo@localhost/icscf"
```
@ -418,6 +506,12 @@ Changes required in kamailio_icscf.cfg:
```
# ------------------ module loading ----------------------------------
mpath="/usr/lib64/kamailio/modules_k/:/usr/lib64/kamailio/modules/:/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/:/usr/lib/x86_64-linux-gnu/kamailio/modules/"
#loadmodule "debugger.so"
# if !($rU =~ "\+.*") {
# prefix("+");
# }
```
To perform a quick test edit the /etc/default/kamailio file, by changing the configuration file parameter as follows:
@ -426,8 +520,15 @@ To perform a quick test edit the /etc/default/kamailio file, by changing the con
# Config file
CFGFILE=/etc/kamailio_icscf/kamailio_icscf.cfg
```
```
$ $ mkdir -p /var/run/kamailio_icscf
$ adduser --quiet --system --group --disabled-password \
--shell /bin/false --gecos "Kamailio" \
--home /var/run/kamailio_icscf kamailio
$ chown kamailio:kamailio /var/run/kamailio_icscf
```
After altering the above file, execute below command
Then, execute below command
```
$ systemctl restart kamailio.service
@ -467,8 +568,7 @@ alias=pcscf.mnc096.mcc262.3gppnetwork.org
#!define WITH_RX
#!define WITH_RX_REG
#!define WITH_RX_CALL
#!define WITH_IPSEC
#!define WITH_TCP
```
Changes required in pcscf.xml:
@ -491,6 +591,18 @@ Changes required in kamailio_pcscf.cfg:
# ------------------ module loading ----------------------------------
mpath="/usr/lib64/kamailio/modules_k/:/usr/lib64/kamailio/modules/:/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/:/usr/lib/x86_64-linux-gnu/kamailio/modules/"
#loadmodule "debugger.so"
/* set the path to RPC fifo control file */
modparam("jsonrpcs", "fifo_name", "/var/run/kamailio_pcscf/kamailio_rpc.fifo")
/* set the path to RPC unix socket control file */
modparam("jsonrpcs", "dgram_socket", "/var/run/kamailio_pcscf/kamailio_rpc.sock")
modparam("tls", "config", "/etc/kamailio_pcscf/tls.cfg")
# ----- ctl params -----
modparam("ctl", "binrpc", "unix:/var/run/kamailio_pcscf/kamailio_ctl")
# AVP's required for Fail-Over-Support:
#modparam("dispatcher", "dst_avp", "$avp(DISPATCHER_DST_AVP)")
#modparam("dispatcher", "grp_avp", "$avp(DISPATCHER_GRP_AVP)")
@ -498,13 +610,29 @@ mpath="/usr/lib64/kamailio/modules_k/:/usr/lib64/kamailio/modules/:/usr/lib/kama
#modparam("dispatcher", "sock_avp", "$avp(DISPATCHER_SOCK_AVP)")
#modparam("ims_usrloc_pcscf", "hashing_type", 2)
#!ifdef WITH_RX
# -- CDP params --
modparam("cdp","config_file","/etc/kamailio_pcscf/pcscf.xml")
# -- diameter_rx params --
modparam("ims_qos", "rx_dest_realm", "localdomain") # Enter realm to which PCRF belongs to
#modparam("ims_qos", "rx_dest_realm", "NETWORKNAME")
#!ifdef WITH_IPSEC
if (!is_method("REGISTER")) {
ipsec_forward("location");
}
#!endif
#!ifdef WITH_IPSEC
ipsec_destroy("location");
#!endif
```
Changes required in dispatcher.list:
```
# SBC's
2 sip:10.4.128.7:5070
```
To perform a quick test edit the /etc/default/kamailio file, by changing the configuration file parameter as follows:
@ -514,7 +642,15 @@ To perform a quick test edit the /etc/default/kamailio file, by changing the con
CFGFILE=/etc/kamailio_pcscf/kamailio_pcscf.cfg
```
After altering the above file, execute below command
```
$ mkdir -p /var/run/kamailio_pcscf
$ adduser --quiet --system --group --disabled-password \
--shell /bin/false --gecos "Kamailio" \
--home /var/run/kamailio_pcscf kamailio
$ chown kamailio:kamailio /var/run/kamailio_pcscf
```
Then, execute below command
```
$ systemctl restart kamailio.service
@ -535,6 +671,8 @@ Changes required in scscf.cfg:
```
# SIP / UDP
listen=udp:10.4.128.7:6060
# SIP / TCP
listen=tcp:10.4.128.7:6060
#!define NETWORKNAME "mnc096.mcc262.3gppnetwork.org"
#!define HOSTNAME "scscf.mnc096.mcc262.3gppnetwork.org"
@ -548,6 +686,8 @@ alias=scscf.mnc096.mcc262.3gppnetwork.org
#!define DB_URL "mysql://scscf:heslo@localhost/scscf"
#!define RO_MNC "96"
#!define WITH_TCP
```
Changes required in scscf.xml:
@ -570,19 +710,44 @@ Changes required in kamailio_scscf.cfg:
# ------------------ module loading ----------------------------------
mpath="/usr/lib64/kamailio/modules_k/:/usr/lib64/kamailio/modules/:/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/:/usr/lib/x86_64-linux-gnu/kamailio/modules/"
#loadmodule "debugger.so"
/* set the path to RPC fifo control file */
modparam("jsonrpcs", "fifo_name", "/var/run/kamailio_scscf/kamailio_rpc.fifo")
/* set the path to RPC unix socket control file */
modparam("jsonrpcs", "dgram_socket", "/var/run/kamailio_scscf/kamailio_rpc.sock")
# ----- ctl params -----
modparam("ctl", "binrpc", "unix:/var/run/kamailio_scscf/kamailio_ctl")
# -- CDP params --
modparam("cdp","config_file","/etc/kamailio_scscf/scscf.xml")
# AVP's required for Fail-Over-Support:
#modparam("dispatcher", "dst_avp", "$avp(DISPATCHER_DST_AVP)")
#modparam("dispatcher", "grp_avp", "$avp(DISPATCHER_GRP_AVP)")
#modparam("dispatcher", "cnt_avp", "$avp(DISPATCHER_CNT_AVP)")
#modparam("dispatcher", "sock_avp", "$avp(DISPATCHER_SOCK_AVP)")
# Terminating
if (uri == myself || uri =~ "tel:.*") {
if (!term_impu_registered("location")) {
xlog("L_DBG", "We need to do an UNREG server SAR assignemnt");
assign_server_unreg("UNREG_SAR_REPLY", "location", "term");
sl_send_reply("403","Forbidden - Domain not served");
exit;
}
}
# } else {
# sl_send_reply("403","Forbidden - Domain not served");
# exit();
# }
```
Changes required in dispatcher.list: Not sure what to do hence comment out as follows
Changes required in dispatcher.list: Not sure what to do hence remove as follows
```
# ng-voice Interconnect
#1 sip:sbc-1.ng-voice.com
#1 sip:sbc-2.ng-voice.com
```
To perform a quick test edit the /etc/default/kamailio file, by changing the configuration file parameter as follows:
@ -592,7 +757,15 @@ To perform a quick test edit the /etc/default/kamailio file, by changing the con
CFGFILE=/etc/kamailio_scscf/kamailio_scscf.cfg
```
After altering the above file, execute below command
```
$ mkdir -p /var/run/kamailio_scscf
$ adduser --quiet --system --group --disabled-password \
--shell /bin/false --gecos "Kamailio" \
--home /var/run/kamailio_scscf kamailio
$ chown kamailio:kamailio /var/run/kamailio_scscf
```
Then, execute below command
```
$ systemctl restart kamailio.service
@ -607,7 +780,7 @@ $ journalctl -f --unit kamailio
Can run S-CSCF as follows: `kamailio -f kamailio_scscf.cfg`
#### 15. Install RTPEngine
#### 14. Install RTPEngine
Check for dependencies, install dependencies and build .deb packages
@ -652,6 +825,14 @@ Port on which rtpengine binds i.e. listen_ng parameter is udp port 2223. This sh
modparam("rtpengine", "rtpengine_sock", "1 == udp:localhost:2223")
```
Edit /etc/default/ngcp-rtpengine-daemon and /etc/default/ngcp-rtpengine-recording-daemon as follows in respective files:
```
RUN_RTPENGINE=yes
```
```
RUN_RTPENGINE_RECORDING=yes
```
```
$ cp /etc/rtpengine/rtpengine-recording.sample.conf /etc/rtpengine/rtpengine-recording.conf
$ mkdir /var/spool/rtpengine
@ -663,7 +844,16 @@ $ systemctl disable rtpproxy
$ systemctl mask rtpproxy
```
#### 16. Running I-CSCF, P-CSCF and S-CSCF as separate systemctl process
Second instance of RTPENGINE can be run as follows:
```
$ iptables -I rtpengine -p udp -j RTPENGINE --id 1
$ ip6tables -I INPUT -p udp -j RTPENGINE --id 1
$ echo 'del 1' > /proc/rtpengine/control
$ /usr/sbin/rtpengine --table=1 --interface=10.4.128.7!172.24.15.21 --listen-ng=127.0.0.1:2224 --tos=184 --pidfile=ngcp-rtpengine-daemon2.pid --no-fallback
```
#### 15. Running I-CSCF, P-CSCF and S-CSCF as separate systemctl process
First, stop the default kamailio SIP server
@ -739,11 +929,277 @@ Finally,
$ systemctl start kamailio_icscf kamailio_pcscf kamailio_scscf
```
#### 17. Ensure NextEPC PCRF of the Core Network is configured to use IMS
#### 16. Setup FoHSS in order to talk with I-CSCF and S-CSCF
Requirements for FoHSS: Install Java JDK and ant
Download Oracle Java 7 JDK from following link using a browser:
https://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html
```
$ mkdir -p /usr/lib/jvm/
$ tar -zxf jdk-7u79-linux-x64.tar.gz -C /usr/lib/jvm/
$ update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_79/bin/java 100
$ update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_79/bin/javac 100
```
Verify that java has been successfully configured by running:
```
$ update-alternatives --display java
java - auto mode
link best version is /usr/lib/jvm/jdk1.7.0_79/bin/java
link currently points to /usr/lib/jvm/jdk1.7.0_79/bin/java
link java is /usr/bin/java
/usr/lib/jvm/jdk1.7.0_79/bin/java - priority 100
$ update-alternatives --display javac
javac - auto mode
link best version is /usr/lib/jvm/jdk1.7.0_79/bin/javac
link currently points to /usr/lib/jvm/jdk1.7.0_79/bin/javac
link javac is /usr/bin/javac
/usr/lib/jvm/jdk1.7.0_79/bin/javac - priority 100
$ update-alternatives --config java
(select java jdk1.7.0_79)
$ update-alternatives --config javac
```
Check java version
```
$ java -version
```
Install Ant
```
$ cd ~
$ wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.14-bin.tar.gz
$ tar xvfvz apache-ant-1.9.14-bin.tar.gz
$ mv apache-ant-1.9.14 /usr/local/
$ sh -c 'echo ANT_HOME=/usr/local/ >> /etc/environment'
$ ln -s /usr/local/apache-ant-1.9.14/bin/ant /usr/bin/ant
```
Verfiy ant version as follows:
```
$ ant -version
Apache Ant(TM) version 1.9.14 compiled on March 12 2019
```
Create working directories for OpenIMSCore:
```
$ mkdir /opt/OpenIMSCore
$ cd /opt/OpenIMSCore
```
Download:
```
$ svn checkout svn://svn.code.sf.net/p/openimscore/code/FHoSS/trunk
$ mv trunk FHoSS
```
Compile:
```
$ cd FHoSS
$ export JAVA_HOME="/usr/lib/jvm/jdk1.7.0_79"
$ export CLASSPATH="/usr/lib/jvm/jdk1.7.0_79/jre/lib/"
$ ant compile deploy | tee ant_compile_deploy.txt
```
Create configurator.sh using below script to change domain names and IP address in all configuration files
```
$ cd deploy
$ vim configurator.sh
```
```
#!/bin/bash
# Initialization & global vars
# if you execute this script for the second time
# you should change these variables to the latest
# domain name and ip address
DDOMAIN="open-ims\.test"
DSDOMAIN="open-ims\\\.test"
DEFAULTIP="127\.0\.0\.1"
CONFFILES=`ls *.cfg *.xml *.sql *.properties 2>/dev/null`
# Interaction
printf "Domain Name:"
read domainname
printf "IP Adress:"
read ip_address
# input domain is to be slashed for cfg regexes
slasheddomain=`echo $domainname | sed 's/\./\\\\\\\\\./g'`
if [ $# != 0 ]
then
printf "changing: "
for j in $*
do
sed -i -e "s/$DDOMAIN/$domainname/g" $j
sed -i -e "s/$DSDOMAIN/$slasheddomain/g" $j
sed -i -e "s/$DEFAULTIP/$ip_address/g" $j
printf "$j "
done
echo
else
printf "File to change [\"all\" for everything, \"exit\" to quit]:"
# loop
while read filename ;
do
if [ "$filename" = "exit" ]
then
printf "exitting...\n"
break ;
elif [ "$filename" = "all" ]
then
printf "changing: "
for i in $CONFFILES
do
sed -i -e "s/$DDOMAIN/$domainname/g" $i
sed -i -e "s/$DSDOMAIN/$slasheddomain/g" $i
sed -i -e "s/$DEFAULTIP/$ip_address/g" $i
printf "$i "
done
echo
break;
elif [ -w $filename ]
then
printf "changing $filename \n"
sed -i -e "s/$DDOMAIN/$domainname/g" $filename
sed -i -e "s/$DSDOMAIN/$slasheddomain/g" $filename
sed -i -e "s/$DEFAULTIP/$ip_address/g" $filename
else
printf "cannot access file $filename. skipping... \n"
fi
printf "File to Change:"
done
fi
```
```
$ chmod +x configurator.sh
$ ./configurator.sh
Domain Name:mnc096.mcc262.3gppnetwork.org
IP Adress:10.4.128.7
$ grep -r "open-ims"
$ vim webapps/hss.web.console/WEB-INF/web.xml
$ vim hibernate.properties
```
And, change the following line
hibernate.connection.url=jdbc:mysql://127.0.0.1:3306/hss_db
```
$ cp configurator.sh ../scripts/
$ cd ../scripts
$ grep -r "open-ims"
$ ./configurator.sh
Domain Name:mnc096.mcc262.3gppnetwork.org
IP Adress:10.4.128.7
$ cp configurator.sh ../config/
$ cd ../config
$ ./configurator.sh
Domain Name:mnc096.mcc262.3gppnetwork.org
IP Adress:10.4.128.7
$ cd ../src-web
$ vim WEB-INF/web.xml
```
And, change open-ims.test to mnc096.mcc262.3gppnetwork.org
Prepare mysql database:
```
$ mysql
<mysql> drop database hss_db;
<mysql> create database hss_db;
<mysql> quit
```
Import database located at /opt/OpenIMSCore into hss_db
```
$ cd /opt/OpenIMSCore
$ mysql -u root -p hss_db < FHoSS/scripts/hss_db.sql
$ mysql -u root -p hss_db < FHoSS/scripts/userdata.sql
```
Check grants for mysql access rights at first time installation:
```
$ mysql
# See last line in hss_db.sql:
<mysql> grant delete,insert,select,update on hss_db.* to hss@localhost identified by 'hss';
<mysql> grant delete,insert,select,update on hss_db.* to hss@'%' identified by 'hss';
```
Check database if domain names are o.k. in various entries and privileges
```
$ mysql -u hss -p
<mysql> show databases;
<mysql> use hss_db;
<mysql> select * from impu;
```
Prepare script-file, start HSS
Copy startup.sh to hss.sh in root directory
```
$ cp /opt/OpenIMSCore/FHoSS/deploy/startup.sh /root/hss.sh
```
And, add the following to hss.sh before echo "Building Classpath"
```
cd /opt/OpenIMSCore/FHoSS/deploy
JAVA_HOME="/usr/lib/jvm/jdk1.7.0_79"
CLASSPATH="/usr/lib/jvm/jdk1.7.0_79/jre/lib/"
```
Start HSS using hss.sh
```
$ ./hss.sh
```
Access the web-interface of HSS: http://<IMS_VM_FLOATING_IP>:8080/hss.web.console/
http://172.24.15.21:8080/hss.web.console/
```
user: hssAdmin
password: hss
```
#### 17. A quick check for the basic working of SIP IMS server can be done as follows
The steps are exactly the same as in Step 11, but now the usernames and passwords are alice and bob, which are the default users present in FoHSS.
#### 18. Ensure NextEPC PCRF of the Core Network is configured to use IMS
In nextepc.conf, add the floating IP of the VM running P-CSCF as shown below
```
parameter:
no_ipv6: true
prefer_ipv4: true
pcscf:
- 172.24.15.21
```