This commit is contained in:
DanB
2016-06-15 17:21:17 +02:00
6 changed files with 25 additions and 35 deletions

View File

@@ -45,6 +45,7 @@ information, please see the [`CONTRIBUTING.md`](CONTRIBUTING.md) file.
| @rbarrabe | Régis Barrabé |
| @J0hnSteel | John Koce Steel |
| @ewsamuels | Errol Samuels |
| @razvancrainea | Răzvan Crainea |
<!-- to sign, include a single line above this comment containing the following text:
| @username | First Last |
-->

View File

@@ -1,6 +1,5 @@
#! /usr/bin/env sh
if test $# -lt 2; then
echo ""
echo "setup_cgr_db.sh <db_user> <db_password> [<db_host>]"
@@ -10,20 +9,20 @@ fi
host=$3
if [ -z "$3" ]; then
host="localhost"
host="localhost"
fi
mysql -u $1 -p$2 -h $host < create_db_with_users.sql
DIR="$(dirname "$(readlink -f "$0")")"
mysql -u $1 -p$2 -h $host < "$DIR"/create_db_with_users.sql
cu=$?
mysql -u $1 -p$2 -h $host -D cgrates < create_cdrs_tables.sql
mysql -u $1 -p$2 -h $host -D cgrates < "$DIR"/create_cdrs_tables.sql
cdrt=$?
mysql -u $1 -p$2 -h $host -D cgrates < create_tariffplan_tables.sql
mysql -u $1 -p$2 -h $host -D cgrates < "$DIR"/create_tariffplan_tables.sql
tpt=$?
if [ $cu = 0 ] && [ $cdrt = 0 ] && [ $tpt = 0 ]; then
echo ""
echo "\t+++ CGR-DB successfully set-up! +++"
echo ""
echo -e "\n\t+++ CGR-DB successfully set-up! +++\n"
exit 0
fi

View File

@@ -5,5 +5,5 @@
sudo -u postgres dropdb -e cgrates
sudo -u postgres dropuser -e cgrates
sudo -u postgres psql -c "CREATE USER cgrates password 'CGRateS.org';"
sudo -u postgres psql -c "CREATE USER cgrates password 'CGRateS.org';"
sudo -u postgres createdb -e -O cgrates cgrates

View File

@@ -3,27 +3,27 @@
user=$1
if [ -z "$1" ]; then
user="cgrates"
user="cgrates"
fi
host=$2
if [ -z "$2" ]; then
host="localhost"
host="localhost"
fi
./create_db_with_users.sh
DIR="$(dirname "$(readlink -f "$0")")"
"$DIR"/create_db_with_users.sh
export PGPASSWORD="CGRateS.org"
psql -U $user -h $host -d cgrates -f create_cdrs_tables.sql
psql -U $user -h $host -d cgrates -f "$DIR"/create_cdrs_tables.sql
cdrt=$?
psql -U $user -h $host -d cgrates -f create_tariffplan_tables.sql
psql -U $user -h $host -d cgrates -f "$DIR"/create_tariffplan_tables.sql
tpt=$?
if [ $cdrt = 0 ] && [ $tpt = 0 ]; then
echo ""
echo "\t+++ CGR-DB successfully set-up! +++"
echo ""
echo -e "\n\t+++ CGR-DB successfully set-up! +++\n"
exit 0
fi

View File

@@ -6,11 +6,10 @@
####### Global Parameters #########
#debug=3
log_level=3
log_stderror=no
log_facility=LOG_LOCAL0
#fork=yes
children=4
listen=udp:lo:5060
listen=udp:eth0:5060
@@ -18,6 +17,9 @@ listen=udp:eth1:5060
auto_aliases=no
# do not open more than 4096 file descriptors
open_files_limit=4096
####### Modules Section ########
#set module path
@@ -91,24 +93,12 @@ modparam("db_flatstore", "single_file", 1)
#### ACCounting module
loadmodule "acc.so"
modparam("acc", "detect_direction", 1)
#modparam("acc", "cdr_flag", "CDR")
#modparam("acc", "evi_flag", "CDR")
#modparam("acc", "evi_missed_flag", "CDR")
modparam("acc", "evi_extra", "cgr_reqtype=$avp(cgr_reqtype);
cgr_account=$avp(cgr_account);
cgr_destination=$avp(cgr_destination);
cgr_supplier=$avp(cgr_supplier);
cgr_answertime=$dlg_val(atime);
cgr_answertime=$dlg_val(atime);
dialog_id=$DLG_did")
#modparam("acc", "db_url", "flatstore:/tmp")
#modparam("acc", "db_flag", "CDR")
#modparam("acc", "db_missed_flag", "CDR")
#modparam("acc", "db_table_missed_calls", "cgr_missed")
#modparam("acc", "db_extra", "cgr_reqtype=$avp(cgr_reqtype);
# cgr_account=$avp(cgr_account);
# cgr_destination=$avp(cgr_destination);
# cgr_supplier=$avp(cgr_supplier);
# dialog_id=$DLG_did")
#### CfgUtils module
loadmodule "cfgutils.so"
@@ -138,7 +128,7 @@ startup_route {
local_route {
if (is_method("BYE") ) {
#setflag(CDR);
# make sure a LOCAL_DISCONNECT event is triggered on local BYEs
acc_evi_request("LOCAL_DISCONNECT"); #FixMe
}
}

View File

@@ -9,8 +9,8 @@ OpenSIPS_
We got OpenSIPS_ installed via following commands:
::
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5F2FBB7C
echo "deb http://apt.opensips.org jessie 2.1-releases" >>/etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 049AD65B
echo "deb http://apt.opensips.org jessie 2.2-releases" >>/etc/apt/sources.list
apt-get update
apt-get install opensips opensips-json-module opensips-restclient-module