mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-19 22:28:45 +05:00
Merge branch 'master' of https://github.com/cgrates/cgrates
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
export GOROOT=/root/go
|
||||
export GOPATH=/root/code
|
||||
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
|
||||
|
||||
sed -i 's/127.0.0.1/0.0.0.0/g' /etc/redis/redis.conf /etc/mysql/my.cnf /etc/postgresql/9.4/main/pg_hba.conf
|
||||
# edit servers config files
|
||||
sed -i 's/127.0.0.1/0.0.0.0/g' /etc/redis/redis.conf /etc/mysql/my.cnf
|
||||
echo 'host all all 0.0.0.0/32 md5'>>/etc/postgresql/9.4/main/pg_hba.conf
|
||||
|
||||
/etc/init.d/mysql start
|
||||
/etc/init.d/postgresql start
|
||||
@@ -16,6 +14,9 @@ ln -s /root/code/src/github.com/cgrates/cgrates /root/cgr
|
||||
cd /usr/share/cgrates/storage/mysql && ./setup_cgr_db.sh root CGRateS.org
|
||||
cd /usr/share/cgrates/storage/postgres && ./setup_cgr_db.sh
|
||||
|
||||
#env vars
|
||||
export GOROOT=/root/go; export GOPATH=/root/code; export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
|
||||
|
||||
# build and install cgrates
|
||||
/root/cgr/update_external_libs.sh
|
||||
go install github.com/cgrates/cgrates
|
||||
@@ -28,4 +29,5 @@ cd /usr/share/cgrates/tutorials/fs_evsock/freeswitch/etc/ && tar xzf freeswitch_
|
||||
|
||||
cd /root/cgr
|
||||
echo "for cgradmin run: cgr-engine -config_dir data/conf/samples/cgradmin"
|
||||
echo 'export GOROOT=/root/go; export GOPATH=/root/code; export PATH=$PATH:$GOROOT/bin:$GOPATH/bin'>>/root/.zshrc
|
||||
zsh
|
||||
|
||||
31
data/docker/osips/Dockerfile
Normal file
31
data/docker/osips/Dockerfile
Normal file
@@ -0,0 +1,31 @@
|
||||
FROM debian:wheezy
|
||||
MAINTAINER Radu Fericean, rif@cgrates.org
|
||||
RUN apt-get -y update
|
||||
|
||||
# set mysql password
|
||||
RUN echo 'mysql-server mysql-server/root_password password CGRateS.org' | debconf-set-selections && echo 'mysql-server mysql-server/root_password_again password CGRateS.org' | debconf-set-selections
|
||||
|
||||
# install dependencies
|
||||
RUN apt-get update && apt-get -y install redis-server mysql-server git sudo wget libcurl3-gnutls libgssapi-krb5-2 libldap-2.4-2 librtmp0 libssh2-1 ca-certificates libsasl2-2 libkrb5support0 libkrb5-3 libkeyutils1 libk5crypto3 openssl libssl1.0.0 libjson0 wget adduser libcurl3-gnutls
|
||||
|
||||
# add cgrates user
|
||||
RUN useradd -c CGRateS -d /var/run/cgrates -s /bin/false -r cgrates
|
||||
|
||||
# install cgrates
|
||||
RUN URL='http://www.cgrates.org/tmp_pkg/cgrates_0.9.1~rc6_amd64.deb'; FILE=`mktemp`; wget "$URL" -qO $FILE && dpkg -i $FILE; rm $FILE
|
||||
|
||||
#install opensips
|
||||
RUN URL='http://cgrates.org/pkg/opensips/opensips_2.1.0-1_amd64.deb'; FILE=`mktemp`; wget "$URL" -qO $FILE && dpkg -i $FILE; rm $FILE
|
||||
RUN URL='http://cgrates.org/pkg/opensips/opensips-json-module_2.1.0-1_amd64.deb'; FILE=`mktemp`; wget "$URL" -qO $FILE && dpkg -i $FILE; rm $FILE
|
||||
|
||||
# init mysql
|
||||
cd /usr/share/cgrates/storage/mysql && ./setup_cgr_db.sh root CGRateS.org
|
||||
|
||||
# add etc files
|
||||
COPY /opensips/etc cgrates/etc /etc
|
||||
|
||||
# cleanup
|
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
|
||||
|
||||
11
data/docker/osips/README.md
Normal file
11
data/docker/osips/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
Docker
|
||||
=======
|
||||
|
||||
From the project root:
|
||||
|
||||
``` bash
|
||||
# build the image
|
||||
docker build -t osips data/docker/ospis
|
||||
# create the container
|
||||
docker run --rm -itv `pwd`:/root/code --name cgr osips
|
||||
```
|
||||
3
data/docker/osips/my.cnf
Normal file
3
data/docker/osips/my.cnf
Normal file
@@ -0,0 +1,3 @@
|
||||
[client]
|
||||
user=root
|
||||
password=CGRateS.org
|
||||
5
data/docker/osips/start.sh
Executable file
5
data/docker/osips/start.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
/etc/init.d/mysql start
|
||||
/etc/init.d/redis-server start
|
||||
|
||||
|
||||
bash --rcfile /root/.bashrc
|
||||
@@ -420,6 +420,10 @@ func (b *Balance) DebitMoney(cd *CallDescriptor, ub *Account, count bool, dryRun
|
||||
ts.createIncrementsSlice()
|
||||
}
|
||||
//log.Printf("TS: %+v", ts)
|
||||
/*if ts.RateInterval == nil {
|
||||
Logger.Err(fmt.Sprintf("Nil RateInterval ERROR on TS: %+v, CC: %+v, from CD: %+v", ts, cc, cd))
|
||||
continue
|
||||
}*/
|
||||
maxCost, strategy := ts.RateInterval.GetMaxCost()
|
||||
//log.Printf("Timing: %+v", ts.RateInterval.Timing)
|
||||
//log.Printf("Rate: %+v", ts.RateInterval.Rating)
|
||||
|
||||
Reference in New Issue
Block a user