mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-20 06:38:45 +05:00
Fix merge conflicts, improving creation of new rpc pool
This commit is contained in:
@@ -77,6 +77,7 @@
|
||||
// "pubsubs": "", // address where to reach the pubusb service, empty to disable pubsub functionality: <""|internal|x.y.z.y:1234>
|
||||
// "users": "", // address where to reach the user service, empty to disable user profile functionality: <""|internal|x.y.z.y:1234>
|
||||
// "aliases": "", // address where to reach the aliases service, empty to disable aliases functionality: <""|internal|x.y.z.y:1234>
|
||||
// "rp_subject_prefix_matching": false, // enables prefix matching for the rating profile subject
|
||||
//},
|
||||
|
||||
|
||||
|
||||
@@ -10,11 +10,25 @@
|
||||
"http": ":2080", // HTTP listening address
|
||||
},
|
||||
|
||||
//"tariffplan_db": { // database used to store offline tariff plans and CDRs
|
||||
// "db_type": "mongo", // stor database type to use: <mysql|postgres>
|
||||
// "db_host": "127.0.0.1", // the host to connect to
|
||||
// "db_port": 27017, // the port to reach the stordb
|
||||
// "db_name": "tpdb",
|
||||
//},
|
||||
//
|
||||
//"data_db": { // database used to store offline tariff plans and CDRs
|
||||
// "db_type": "mongo", // stor database type to use: <mysql|postgres>
|
||||
// "db_host": "127.0.0.1", // the host to connect to
|
||||
// "db_port": 27017, // the port to reach the stordb
|
||||
// "db_name": "datadb",
|
||||
//},
|
||||
|
||||
"stor_db": { // database used to store offline tariff plans and CDRs
|
||||
"db_type": "mongo", // stor database type to use: <mysql|postgres>
|
||||
"db_host": "127.0.0.1", // the host to connect to
|
||||
"db_port": 27017, // the port to reach the stordb
|
||||
"db_name": "cgrates",
|
||||
"db_name": "stordb",
|
||||
},
|
||||
|
||||
"rater": {
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
|
||||
"diameter_agent": {
|
||||
"enabled": true,
|
||||
"pubsubs": "internal",
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@@ -4,26 +4,45 @@
|
||||
"request_processors": [
|
||||
{
|
||||
"id": "*default", // formal identifier of this processor
|
||||
"dry_run": false, // do not send the events to SMG, just log them
|
||||
"request_filter": "Service-Context-Id(^voice)", // filter requests processed by this processor
|
||||
"request_filter": "Service-Context-Id(nonexistent)", // cancel matching of this processor
|
||||
},
|
||||
{
|
||||
"id": "dryrun1", // formal identifier of this processor
|
||||
"dry_run": true, // do not send the events to SMG, just log them
|
||||
"request_filter": "Service-Context-Id(dryrun1)", // filter requests processed by this processor
|
||||
"continue_on_success": false, // continue to the next template if executed
|
||||
"ccr_fields":[ // import content_fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value
|
||||
{"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "^*voice", "mandatory": true},
|
||||
{"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "^*sms", "mandatory": true},
|
||||
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "Session-Id", "mandatory": true},
|
||||
{"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "^*prepaid", "mandatory": true},
|
||||
{"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "^*out", "mandatory": true},
|
||||
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "^cgrates.org", "mandatory": true},
|
||||
{"tag": "Category", "field_id": "Category", "type": "*composed", "value": "^call", "mandatory": true},
|
||||
{"tag": "Account", "field_id": "Account", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Subject", "field_id": "Subject", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Destination", "field_id": "Destination", "type": "*composed", "value": "Service-Information>IN-Information>Real-Called-Number", "mandatory": true},
|
||||
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true},
|
||||
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true},
|
||||
{"tag": "Usage", "field_id": "Usage", "type": "*handler", "handler_id": "*ccr_usage", "mandatory": true},
|
||||
{"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*composed", "value": "Subscription-Id>Subscription-Id-Data", "mandatory": true},
|
||||
],
|
||||
"cca_fields":[ // fields returned in CCA
|
||||
{"tag": "GrantedUnits", "field_id": "Granted-Service-Unit>CC-Time", "type": "*handler", "handler_id": "*cca_usage", "mandatory": true},
|
||||
{"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "300"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"id": "pubsub1", // formal identifier of this processor
|
||||
"dry_run": true, // do not send the events to SMG, just log them
|
||||
"publish_event": true,
|
||||
"request_filter": "Service-Context-Id(pubsub1)", // filter requests processed by this processor
|
||||
"continue_on_success": false, // continue to the next template if executed
|
||||
"ccr_fields":[ // import content_fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value
|
||||
{"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "^*sms", "mandatory": true},
|
||||
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "Session-Id", "mandatory": true},
|
||||
{"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "^*prepaid", "mandatory": true},
|
||||
{"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "^*out", "mandatory": true},
|
||||
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "^cgrates.org", "mandatory": true},
|
||||
{"tag": "Category", "field_id": "Category", "type": "*composed", "value": "^call", "mandatory": true},
|
||||
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true},
|
||||
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true},
|
||||
],
|
||||
"cca_fields":[ // fields returned in CCA
|
||||
{"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "300"},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -45,7 +64,14 @@
|
||||
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true},
|
||||
{"tag": "Usage", "field_id": "Usage", "type": "*composed", "value": "Requested-Service-Unit>CC-Time", "mandatory": true},
|
||||
],
|
||||
"cca_fields":[
|
||||
{"tag": "ResultCode", "field_filter":"CGRError(ACCOUNT_NOT_FOUND)",
|
||||
"field_id": "Result-Code", "type": "*constant", "value": "5030"},
|
||||
{"tag": "ResultCode", "field_filter":"CGRError(USER_NOT_FOUND)",
|
||||
"field_id": "Result-Code", "type": "*constant", "value": "5030"},
|
||||
],
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
29
data/conf/samples/dmtagent/simpa.json
Normal file
29
data/conf/samples/dmtagent/simpa.json
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
{
|
||||
|
||||
"diameter_agent": {
|
||||
"request_processors": [
|
||||
{
|
||||
"id": "simpa_event", // formal identifier of this processor
|
||||
"dry_run": false, // do not send the events to SMG, just log them
|
||||
"request_filter": "Service-Context-Id(^simpa);CC-Request-Type(4)", // filter requests processed by this processor
|
||||
"continue_on_success": false, // continue to the next template if executed
|
||||
"ccr_fields":[ // import content_fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value
|
||||
{"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "^*generic", "mandatory": true},
|
||||
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "Session-Id", "mandatory": true},
|
||||
{"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "^*prepaid", "mandatory": true},
|
||||
{"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "^*out", "mandatory": true},
|
||||
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "^cgrates.org", "mandatory": true},
|
||||
{"tag": "Category", "field_id": "Category", "type": "*composed", "value": "^generic", "mandatory": true},
|
||||
{"tag": "Account", "field_id": "Account", "type": "*composed", "value": "Subscription-Id>Subscription-Id-Data", "field_filter":"Subscription-Id>Subscription-Id-Type(0)", "mandatory": true},
|
||||
{"tag": "Subject", "field_id": "Subject", "type": "*composed", "value": "Subscription-Id>Subscription-Id-Data", "field_filter":"Subscription-Id>Subscription-Id-Type(0)", "mandatory": true},
|
||||
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true},
|
||||
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true},
|
||||
{"tag": "Usage", "field_id": "Usage", "type": "*handler", "handler_id": "*value_exponent",
|
||||
"value": "Requested-Service-Unit>CC-Money>Unit-Value>Value-Digits;^|;Requested-Service-Unit>CC-Money>Unit-Value>Exponent", "mandatory": true},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
}
|
||||
88
data/conf/samples/dmtagent/voice.json
Normal file
88
data/conf/samples/dmtagent/voice.json
Normal file
@@ -0,0 +1,88 @@
|
||||
|
||||
{
|
||||
|
||||
"diameter_agent": {
|
||||
"request_processors": [
|
||||
{
|
||||
"id": "VoiceInit", // formal identifier of this processor
|
||||
"dry_run": false, // do not send the events to SMG, just log them
|
||||
"request_filter": "Service-Context-Id(^voice);CC-Request-Type(1)", // filter requests processed by this processor
|
||||
"continue_on_success": false, // continue to the next template if executed
|
||||
"ccr_fields":[ // import content_fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value
|
||||
{"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "^*voice", "mandatory": true},
|
||||
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "Session-Id", "mandatory": true},
|
||||
{"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "^*out", "mandatory": true},
|
||||
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Category", "field_id": "Category", "type": "*composed", "value": "^call", "mandatory": true},
|
||||
{"tag": "Account", "field_id": "Account", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Subject", "field_id": "Subject", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Destination", "field_id": "Destination", "type": "*composed", "value": "Service-Information>IN-Information>Real-Called-Number", "mandatory": true},
|
||||
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true},
|
||||
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true},
|
||||
{"tag": "Usage", "field_id": "Usage", "type": "*handler", "handler_id": "*ccr_usage", "mandatory": true},
|
||||
{"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*composed", "value": "Subscription-Id>Subscription-Id-Data", "mandatory": true},
|
||||
],
|
||||
"cca_fields":[
|
||||
{"tag": "ResultCode", "field_filter":"CGRError(ACCOUNT_NOT_FOUND)",
|
||||
"field_id": "Result-Code", "type": "*constant", "value": "5030"},
|
||||
{"tag": "ResultCode", "field_filter":"CGRError(USER_NOT_FOUND)",
|
||||
"field_id": "Result-Code", "type": "*constant", "value": "5030"},
|
||||
{"tag": "GrantedUnits", "field_filter":"CGRError(^$)",
|
||||
"field_id": "Granted-Service-Unit>CC-Time", "type": "*composed", "value": "CGRMaxUsage", "mandatory": true},
|
||||
],
|
||||
},
|
||||
{
|
||||
"id": "VoiceUpdate", // formal identifier of this processor
|
||||
"dry_run": false, // do not send the events to SMG, just log them
|
||||
"request_filter": "Service-Context-Id(^voice);CC-Request-Type(2)", // filter requests processed by this processor
|
||||
"continue_on_success": false, // continue to the next template if executed
|
||||
"ccr_fields":[ // import content_fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value
|
||||
{"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "^*voice", "mandatory": true},
|
||||
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "Session-Id", "mandatory": true},
|
||||
{"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "^*out", "mandatory": true},
|
||||
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Category", "field_id": "Category", "type": "*composed", "value": "^call", "mandatory": true},
|
||||
{"tag": "Account", "field_id": "Account", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Subject", "field_id": "Subject", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Destination", "field_id": "Destination", "type": "*composed", "value": "Service-Information>IN-Information>Real-Called-Number", "mandatory": true},
|
||||
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true},
|
||||
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true},
|
||||
{"tag": "Usage", "field_id": "Usage", "type": "*handler", "handler_id": "*ccr_usage", "mandatory": true},
|
||||
{"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*composed", "value": "Subscription-Id>Subscription-Id-Data", "mandatory": true},
|
||||
],
|
||||
"cca_fields":[ // fields returned in CCA
|
||||
{"tag": "GrantedUnits", "field_filter":"CGRError(^$)",
|
||||
"field_id": "Granted-Service-Unit>CC-Time", "type": "*composed", "value": "CGRMaxUsage", "mandatory": true},
|
||||
],
|
||||
},
|
||||
{
|
||||
"id": "VoiceTerminate", // formal identifier of this processor
|
||||
"dry_run": false, // do not send the events to SMG, just log them
|
||||
"request_filter": "Service-Context-Id(^voice);CC-Request-Type(3)", // filter requests processed by this processor
|
||||
"continue_on_success": false, // continue to the next template if executed
|
||||
"ccr_fields":[ // import content_fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value
|
||||
{"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "^*voice", "mandatory": true},
|
||||
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "Session-Id", "mandatory": true},
|
||||
{"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "^*out", "mandatory": true},
|
||||
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Category", "field_id": "Category", "type": "*composed", "value": "^call", "mandatory": true},
|
||||
{"tag": "Account", "field_id": "Account", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Subject", "field_id": "Subject", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Destination", "field_id": "Destination", "type": "*composed", "value": "Service-Information>IN-Information>Real-Called-Number", "mandatory": true},
|
||||
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true},
|
||||
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true},
|
||||
{"tag": "Usage", "field_id": "Usage", "type": "*handler", "handler_id": "*ccr_usage", "mandatory": true},
|
||||
{"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*composed", "value": "Subscription-Id>Subscription-Id-Data", "mandatory": true},
|
||||
],
|
||||
"cca_fields":[ // fields returned in CCA
|
||||
{"tag": "GrantedUnits", "field_filter":"CGRError(^$)",
|
||||
"field_id": "Granted-Service-Unit>CC-Time", "type": "*composed", "value": "CGRMaxUsage", "mandatory": true},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<diameter>
|
||||
<application id="1">
|
||||
<application id="4">
|
||||
<!-- Diameter Network Access Server Application -->
|
||||
<!-- http://tools.ietf.org/html/rfc7155 -->
|
||||
<command code="265" short="AA" name="AA">
|
||||
|
||||
@@ -11,10 +11,10 @@ RUN gpg --keyserver pool.sks-keyservers.net --recv-key D76EDC7725E010CF && gpg -
|
||||
RUN echo 'deb http://files.freeswitch.org/repo/deb/debian/ jessie main' > /etc/apt/sources.list.d/freeswitch.list
|
||||
|
||||
# add mongo repo keys
|
||||
RUN apt-key adv --keyserver 'keyserver.ubuntu.com' --recv '7F0CEB10'
|
||||
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
|
||||
|
||||
# add mongo repo
|
||||
RUN echo 'deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 main' | tee '/etc/apt/sources.list.d/mongodb-org-3.0.list'
|
||||
RUN echo 'deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.2 main' | tee '/etc/apt/sources.list.d/mongodb-org-3.2.list'
|
||||
|
||||
# install dependencies
|
||||
RUN apt-get -y update && apt-get -y install git bzr mercurial redis-server mysql-server python-pycurl python-mysqldb postgresql postgresql-client sudo wget freeswitch-meta-vanilla vim zsh mongodb-org
|
||||
@@ -26,7 +26,7 @@ COPY mongod.conf /etc/mongod.conf
|
||||
RUN useradd -c CGRateS -d /var/run/cgrates -s /bin/false -r cgrates
|
||||
|
||||
# install golang
|
||||
RUN wget -qO- https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz | tar xzf - -C /root/
|
||||
RUN wget -qO- https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz | tar xzf - -C /root/
|
||||
|
||||
#install glide
|
||||
RUN GOROOT=/root/go GOPATH=/root/code /root/go/bin/go get github.com/Masterminds/glide
|
||||
|
||||
@@ -24,11 +24,10 @@ mongo --eval 'db.createUser({"user":"cgrates", "pwd":"CGRateS.org", "roles":[{ro
|
||||
|
||||
#env vars
|
||||
export GOROOT=/root/go; export GOPATH=/root/code; export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
|
||||
export GO15VENDOREXPERIMENT=1
|
||||
|
||||
# build and install cgrates
|
||||
cd /root/cgr
|
||||
#glide -y devel.yaml up
|
||||
#glide -y devel.yaml install
|
||||
./build.sh
|
||||
|
||||
# create cgr-engine link
|
||||
|
||||
@@ -152,16 +152,16 @@ CREATE TABLE `tp_actions` (
|
||||
`balance_tag` varchar(64) NOT NULL,
|
||||
`balance_type` varchar(24) NOT NULL,
|
||||
`directions` varchar(8) NOT NULL,
|
||||
`units` DECIMAL(20,4) NOT NULL,
|
||||
`units` varchar(24) NOT NULL,
|
||||
`expiry_time` varchar(24) NOT NULL,
|
||||
`timing_tags` varchar(128) NOT NULL,
|
||||
`destination_tags` varchar(64) NOT NULL,
|
||||
`rating_subject` varchar(64) NOT NULL,
|
||||
`categories` varchar(32) NOT NULL,
|
||||
`shared_groups` varchar(64) NOT NULL,
|
||||
`balance_weight` DECIMAL(8,2) NOT NULL,
|
||||
`balance_blocker` BOOLEAN NOT NULL,
|
||||
`balance_disabled` BOOLEAN NOT NULL,
|
||||
`balance_weight` varchar(10) NOT NULL,
|
||||
`balance_blocker` varchar(5) NOT NULL,
|
||||
`balance_disabled` varchar(24) NOT NULL,
|
||||
`extra_parameters` varchar(256) NOT NULL,
|
||||
`filter` varchar(256) NOT NULL,
|
||||
`weight` DECIMAL(8,2) NOT NULL,
|
||||
@@ -203,6 +203,8 @@ CREATE TABLE `tp_action_triggers` (
|
||||
`threshold_value` DECIMAL(20,4) NOT NULL,
|
||||
`recurrent` BOOLEAN NOT NULL,
|
||||
`min_sleep` varchar(16) NOT NULL,
|
||||
`expiry_time` varchar(24) NOT NULL,
|
||||
`activation_time` varchar(24) NOT NULL,
|
||||
`balance_tag` varchar(64) NOT NULL,
|
||||
`balance_type` varchar(24) NOT NULL,
|
||||
`balance_directions` varchar(8) NOT NULL,
|
||||
@@ -212,9 +214,9 @@ CREATE TABLE `tp_action_triggers` (
|
||||
`balance_shared_groups` varchar(64) NOT NULL,
|
||||
`balance_expiry_time` varchar(24) NOT NULL,
|
||||
`balance_timing_tags` varchar(128) NOT NULL,
|
||||
`balance_weight` DECIMAL(8,2) NOT NULL,
|
||||
`balance_blocker` BOOL NOT NULL,
|
||||
`balance_disabled` BOOL NOT NULL,
|
||||
`balance_weight` varchar(10) NOT NULL,
|
||||
`balance_blocker` varchar(5) NOT NULL,
|
||||
`balance_disabled` varchar(5) NOT NULL,
|
||||
`min_queued_items` int(11) NOT NULL,
|
||||
`actions_tag` varchar(64) NOT NULL,
|
||||
`weight` DECIMAL(8,2) NOT NULL,
|
||||
|
||||
@@ -36,7 +36,7 @@ CREATE TABLE cdrs (
|
||||
);
|
||||
;
|
||||
DROP INDEX IF EXISTS deleted_at_cp_idx;
|
||||
CREATE INDEX deleted_at_cp_idx ON cdrs_primary (deleted_at);
|
||||
CREATE INDEX deleted_at_cp_idx ON cdrs (deleted_at);
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS sm_costs;
|
||||
|
||||
@@ -109,7 +109,7 @@ CREATE TABLE tp_rating_profiles (
|
||||
activation_time VARCHAR(24) NOT NULL,
|
||||
rating_plan_tag VARCHAR(64) NOT NULL,
|
||||
fallback_subjects VARCHAR(64),
|
||||
cdr_stat_queue_ids varchar(64),
|
||||
cdr_stat_queue_ids VARCHAR(64),
|
||||
created_at TIMESTAMP,
|
||||
UNIQUE (tpid, loadid, tenant, category, direction, subject, activation_time)
|
||||
);
|
||||
@@ -147,16 +147,16 @@ CREATE TABLE tp_actions (
|
||||
balance_tag VARCHAR(64) NOT NULL,
|
||||
balance_type VARCHAR(24) NOT NULL,
|
||||
directions VARCHAR(8) NOT NULL,
|
||||
units NUMERIC(20,4) NOT NULL,
|
||||
units VARCHAR(10) NOT NULL,
|
||||
expiry_time VARCHAR(24) NOT NULL,
|
||||
timing_tags VARCHAR(128) NOT NULL,
|
||||
destination_tags VARCHAR(64) NOT NULL,
|
||||
rating_subject VARCHAR(64) NOT NULL,
|
||||
categories VARCHAR(32) NOT NULL,
|
||||
shared_groups VARCHAR(64) NOT NULL,
|
||||
balance_weight NUMERIC(8,2) NOT NULL,
|
||||
balance_blocker BOOLEAN NOT NULL,
|
||||
balance_disabled BOOLEAN NOT NULL,
|
||||
balance_weight VARCHAR(10) NOT NULL,
|
||||
balance_blocker VARCHAR(5) NOT NULL,
|
||||
balance_disabled VARCHAR(5) NOT NULL,
|
||||
extra_parameters VARCHAR(256) NOT NULL,
|
||||
filter VARCHAR(256) NOT NULL,
|
||||
weight NUMERIC(8,2) NOT NULL,
|
||||
@@ -198,6 +198,8 @@ CREATE TABLE tp_action_triggers (
|
||||
threshold_value NUMERIC(20,4) NOT NULL,
|
||||
recurrent BOOLEAN NOT NULL,
|
||||
min_sleep VARCHAR(16) NOT NULL,
|
||||
expiry_time VARCHAR(24) NOT NULL,
|
||||
activation_time VARCHAR(24) NOT NULL,
|
||||
balance_tag VARCHAR(64) NOT NULL,
|
||||
balance_type VARCHAR(24) NOT NULL,
|
||||
balance_directions VARCHAR(8) NOT NULL,
|
||||
@@ -207,9 +209,9 @@ CREATE TABLE tp_action_triggers (
|
||||
balance_shared_groups VARCHAR(64) NOT NULL,
|
||||
balance_expiry_time VARCHAR(24) NOT NULL,
|
||||
balance_timing_tags VARCHAR(128) NOT NULL,
|
||||
balance_weight NUMERIC(8,2) NOT NULL,
|
||||
balance_blocker BOOL NOT NULL,
|
||||
balance_disabled BOOL NOT NULL,
|
||||
balance_weight VARCHAR(10) NOT NULL,
|
||||
balance_blocker VARCHAR(5) NOT NULL,
|
||||
balance_disabled VARCHAR(5) NOT NULL,
|
||||
min_queued_items INTEGER NOT NULL,
|
||||
actions_tag VARCHAR(64) NOT NULL,
|
||||
weight NUMERIC(8,2) NOT NULL,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#Tag[0],UniqueId[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],BalanceTag[6],BalanceType[7],BalanceDirections[8],BalanceCategories[9],BalanceDestinationTags[10],BalanceRatingSubject[11],BalanceSharedGroup[12],BalanceExpiryTime[13],BalanceTimingTags[14],BalanceWeight[15],BalanceBlocker[16],BalanceDisabled[17],StatsMinQueuedItems[18],ActionsTag[19],Weight[20]
|
||||
CDRST3_WARN_ASR,,*min_asr,45,true,1h,,,,,,,,,,,,,3,CDRST_LOG,10
|
||||
CDRST3_WARN_ACD,,*min_acd,10,true,1h,,,,,,,,,,,,,5,CDRST_LOG,10
|
||||
CDRST3_WARN_ACC,,*max_acc,10,true,10m,,,,,,,,,,,,,5,CDRST_LOG,10
|
||||
CDRST4_WARN_ASR,,*min_asr,30,true,0,,,,,,,,,,,,,5,CDRST_LOG,10
|
||||
CDRST4_WARN_ACD,,*min_acd,3,true,0,,,,,,,,,,,,,2,CDRST_LOG,10
|
||||
#Tag[0],UniqueId[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],ExpiryTime[6],ActivationTime[7],BalanceTag[8],BalanceType[9],BalanceDirections[10],BalanceCategories[11],BalanceDestinationIds[12],BalanceRatingSubject[13],BalanceSharedGroup[14],BalanceExpiryTime[15],BalanceTimingIds[16],BalanceWeight[17],BalanceBlocker[18],BalanceDisabled[19],StatsMinQueuedItems[20],ActionsId[21],Weight[22]
|
||||
CDRST3_WARN_ASR,,*min_asr,45,true,1h,,,,,,,,,,,,,,,3,CDRST_LOG,10
|
||||
CDRST3_WARN_ACD,,*min_acd,10,true,1h,,,,,,,,,,,,,,,5,CDRST_LOG,10
|
||||
CDRST3_WARN_ACC,,*max_acc,10,true,10m,,,,,,,,,,,,,,,5,CDRST_LOG,10
|
||||
CDRST4_WARN_ASR,,*min_asr,30,true,0,,,,,,,,,,,,,,,5,CDRST_LOG,10
|
||||
CDRST4_WARN_ACD,,*min_acd,3,true,0,,,,,,,,,,,,,,,2,CDRST_LOG,10
|
||||
|
||||
|
@@ -1,9 +0,0 @@
|
||||
#Tag[0],UniqueId[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],BalanceTag[6],BalanceType[7],BalanceDirections[8],BalanceCategories[9],BalanceDestinationTags[10],BalanceRatingSubject[11],BalanceSharedGroup[12],BalanceExpiryTime[13],BalanceTimingTags[14],BalanceWeight[15],BalanceBlocker[16],BalanceDisabled[17],StatsMinQueuedItems[18],ActionsTag[19],Weight[20]
|
||||
STANDARD_TRIGGERS,,*min_balance,2,false,0,,*monetary,*out,,,,,,,,,,,LOG_BALANCE,10
|
||||
STANDARD_TRIGGERS,,*max_balance,20,false,0,,*monetary,*out,,,,,,,,,,,LOG_BALANCE,10
|
||||
STANDARD_TRIGGERS,,*max_event_counter,15,false,0,,*monetary,*out,,FS_USERS,,,,,,,,,LOG_BALANCE,10
|
||||
CDRST1_WARN_ASR,,*min_asr,45,true,1h,,,,,,,,,,,,,3,CDRST_WARN_HTTP,10
|
||||
CDRST1_WARN_ACD,,*min_acd,10,true,1h,,,,,,,,,,,,,5,CDRST_WARN_HTTP,10
|
||||
CDRST1_WARN_ACC,,*max_acc,10,true,10m,,,,,,,,,,,,,5,CDRST_WARN_HTTP,10
|
||||
CDRST2_WARN_ASR,,*min_asr,30,true,0,,,,,,,,,,,,,5,CDRST_WARN_HTTP,10
|
||||
CDRST2_WARN_ACD,,*min_acd,3,true,0,,,,,,,,,,,,,2,CDRST_LOG,10
|
||||
|
@@ -4,3 +4,4 @@ cgrates.org,1002,PREPAID_10,STANDARD_TRIGGERS,,
|
||||
cgrates.org,1003,PREPAID_10,STANDARD_TRIGGERS,,
|
||||
cgrates.org,1004,PREPAID_10,STANDARD_TRIGGERS,,
|
||||
cgrates.org,1005,PREPAID_10,STANDARD_TRIGGERS,,
|
||||
cgrates.org,1009,TEST_EXE,,,
|
||||
|
@@ -1,3 +1,4 @@
|
||||
#Tag,ActionsTag,TimingTag,Weight
|
||||
PREPAID_10,PREPAID_10,ASAP,10
|
||||
PREPAID_10,BONUS_1,ASAP,10
|
||||
TEST_EXE,TOPUP_EXE,ALWAYS,10
|
||||
|
9
data/tariffplans/testtp/ActionTriggers.csv
Normal file
9
data/tariffplans/testtp/ActionTriggers.csv
Normal file
@@ -0,0 +1,9 @@
|
||||
#Tag[0],UniqueId[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],ExpiryTime[6],ActivationTime[7],BalanceTag[8],BalanceType[9],BalanceDirections[10],BalanceCategories[11],BalanceDestinationIds[12],BalanceRatingSubject[13],BalanceSharedGroup[14],BalanceExpiryTime[15],BalanceTimingIds[16],BalanceWeight[17],BalanceBlocker[18],BalanceDisabled[19],StatsMinQueuedItems[20],ActionsId[21],Weight[22]
|
||||
STANDARD_TRIGGERS,,*min_balance,2,false,0,,,,*monetary,*out,,,,,,,,,,,LOG_BALANCE,10
|
||||
STANDARD_TRIGGERS,,*max_balance,20,false,0,,,,*monetary,*out,,,,,,,,,,,LOG_BALANCE,10
|
||||
STANDARD_TRIGGERS,,*max_event_counter,15,false,0,,,,*monetary,*out,,FS_USERS,,,,,,,,,LOG_BALANCE,10
|
||||
CDRST1_WARN_ASR,,*min_asr,45,true,1h,,,,,,,,,,,,,,,3,CDRST_WARN_HTTP,10
|
||||
CDRST1_WARN_ACD,,*min_acd,10,true,1h,,,,,,,,,,,,,,,5,CDRST_WARN_HTTP,10
|
||||
CDRST1_WARN_ACC,,*max_acc,10,true,10m,,,,,,,,,,,,,,,5,CDRST_WARN_HTTP,10
|
||||
CDRST2_WARN_ASR,,*min_asr,30,true,0,,,,,,,,,,,,,,,5,CDRST_WARN_HTTP,10
|
||||
CDRST2_WARN_ACD,,*min_acd,3,true,0,,,,,,,,,,,,,,,2,CDRST_LOG,10
|
||||
|
@@ -4,3 +4,4 @@ BONUS_1,*topup,,,,*monetary,*out,,*any,,,*unlimited,,1,10,false,false,10
|
||||
LOG_BALANCE,*log,,,,,,,,,,,,,,false,false,10
|
||||
CDRST_WARN_HTTP,*call_url,http://localhost:8080,,,,,,,,,,,,,false,false,10
|
||||
CDRST_LOG,*log,,,,,,,,,,,,,,false,false,10
|
||||
TOPUP_EXE,*topup,,,,*monetary,*out,,*any,,,*unlimited,,5,10,false,false,10
|
||||
|
@@ -1,3 +1,3 @@
|
||||
#Tag,Years,Months,MonthDays,WeekDays,Time
|
||||
ALWAYS,*any,*any,*any,*any,00:00:00
|
||||
ASAP,*any,*any,*any,*any,*asap
|
||||
ASAP,*any,*any,*any,*any,*asap
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#Tag[0],UniqueId[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],BalanceTag[6],BalanceType[7],BalanceDirections[8],BalanceCategories[9],BalanceDestinationIds[10],BalanceRatingSubject[11],BalanceSharedGroup[12],BalanceExpiryTime[13],BalanceTimingIds[14],BalanceWeight[15],BalanceBlocker[16],BalanceDisabled[17],StatsMinQueuedItems[18],ActionsId[19],Weight[20]
|
||||
STANDARD_TRIGGERS,,*min_balance,2,false,0,,*monetary,*out,,,,,,,,,,,LOG_WARNING,10
|
||||
STANDARD_TRIGGERS,,*max_event_counter,5,false,0,,*monetary,*out,,FS_USERS,,,,,,,,,LOG_WARNING,10
|
||||
STANDARD_TRIGGERS,,*max_balance,20,false,0,,*monetary,*out,,,,,,,,,,,LOG_WARNING,10
|
||||
STANDARD_TRIGGERS,,*max_balance,100,false,0,,*monetary,*out,,,,,,,,,,,DISABLE_AND_LOG,10
|
||||
CDRST1_WARN,,*min_asr,45,true,1m,,,,,,,,,,,,,3,LOG_WARNING,10
|
||||
CDRST1_WARN,,*min_acd,10,true,1m,,,,,,,,,,,,,5,LOG_WARNING,10
|
||||
CDRST1_WARN,,*max_acc,10,true,1m,,,,,,,,,,,,,5,LOG_WARNING,10
|
||||
CDRST1001_WARN,,*min_asr,65,true,1m,,,,,,,,,,,,,3,LOG_WARNING,10
|
||||
CDRST1001_WARN,,*min_acd,10,true,1m,,,,,,,,,,,,,5,LOG_WARNING,10
|
||||
CDRST1001_WARN,,*max_acc,5,true,1m,,,,,,,,,,,,,5,LOG_WARNING,10
|
||||
CDRST3_WARN,,*min_acd,60,false,1m,,,,,,,,,,,,,5,LOG_WARNING,10
|
||||
#Tag[0],UniqueId[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],ExpiryTime[6],ActivationTime[7],BalanceTag[8],BalanceType[9],BalanceDirections[10],BalanceCategories[11],BalanceDestinationIds[12],BalanceRatingSubject[13],BalanceSharedGroup[14],BalanceExpiryTime[15],BalanceTimingIds[16],BalanceWeight[17],BalanceBlocker[18],BalanceDisabled[19],StatsMinQueuedItems[20],ActionsId[21],Weight[22]
|
||||
STANDARD_TRIGGERS,,*min_balance,2,false,0,,,,*monetary,*out,,,,,,,,,,,LOG_WARNING,10
|
||||
STANDARD_TRIGGERS,,*max_event_counter,5,false,0,,,,*monetary,*out,,FS_USERS,,,,,,,,,LOG_WARNING,10
|
||||
STANDARD_TRIGGERS,,*max_balance,20,false,0,,,,*monetary,*out,,,,,,,,,,,LOG_WARNING,10
|
||||
STANDARD_TRIGGERS,,*max_balance,100,false,0,,,,*monetary,*out,,,,,,,,,,,DISABLE_AND_LOG,10
|
||||
CDRST1_WARN,,*min_asr,45,true,1m,,,,,,,,,,,,,,,3,LOG_WARNING,10
|
||||
CDRST1_WARN,,*min_acd,10,true,1m,,,,,,,,,,,,,,,5,LOG_WARNING,10
|
||||
CDRST1_WARN,,*max_acc,10,true,1m,,,,,,,,,,,,,,,5,LOG_WARNING,10
|
||||
CDRST1001_WARN,,*min_asr,65,true,1m,,,,,,,,,,,,,,,3,LOG_WARNING,10
|
||||
CDRST1001_WARN,,*min_acd,10,true,1m,,,,,,,,,,,,,,,5,LOG_WARNING,10
|
||||
CDRST1001_WARN,,*max_acc,5,true,1m,,,,,,,,,,,,,,,5,LOG_WARNING,10
|
||||
CDRST3_WARN,,*min_acd,60,false,1m,,,,,,,,,,,,,,,5,LOG_WARNING,10
|
||||
|
||||
|
@@ -8,3 +8,4 @@ DR_FS_10CNT,DST_FS,RT_10CNT,*up,4,0,
|
||||
DR_SPECIAL_1002,DST_1002,RT_1CNT,*up,4,0,
|
||||
DR_1007_MAXCOST_DISC,DST_1007,RT_1CNT_PER_SEC,*up,4,0.62,*disconnect
|
||||
DR_1007_MAXCOST_FREE,DST_1007,RT_1CNT_PER_SEC,*up,4,0.62,*free
|
||||
DR_GENERIC,*any,RT_GENERIC_1,*up,4,0,
|
||||
|
||||
|
@@ -7,3 +7,4 @@ RT_40CNT,0.8,0.4,60s,30s,0s
|
||||
RT_40CNT,0,0.2,60s,10s,60s
|
||||
RT_1CNT,0,0.01,60s,60s,0s
|
||||
RT_1CNT_PER_SEC,0,0.01,1s,1s,0s
|
||||
RT_GENERIC_1,0,1,1,1,0
|
||||
|
||||
|
@@ -18,3 +18,4 @@ RP_RETAIL2,DR_FS_10CNT,OFFPEAK_EVENING,10
|
||||
RP_RETAIL2,DR_FS_10CNT,OFFPEAK_WEEKEND,10
|
||||
RP_RETAIL2,DR_1007_MAXCOST_FREE,ALWAYS,10
|
||||
RP_SPECIAL_1002,DR_SPECIAL_1002,ALWAYS,10
|
||||
RP_GENERIC,DR_GENERIC,*any,10
|
||||
|
@@ -7,3 +7,4 @@
|
||||
*out,cgrates.org,lcr_profile2,suppl1,2014-01-14T00:00:00Z,RP_RETAIL2,,STATS_SUPPL1
|
||||
*out,cgrates.org,lcr_profile2,suppl2,2014-01-14T00:00:00Z,RP_RETAIL1,,STATS_SUPPL2
|
||||
*out,cgrates.org,lcr_profile2,suppl3,2014-01-14T00:00:00Z,RP_SPECIAL_1002,,
|
||||
*out,cgrates.org,generic,*any,2014-01-14T00:00:00Z,RP_GENERIC,,
|
||||
|
||||
|
@@ -4,4 +4,4 @@ ASAP,*any,*any,*any,*any,*asap
|
||||
PEAK,*any,*any,*any,1;2;3;4;5,08:00:00
|
||||
OFFPEAK_MORNING,*any,*any,*any,1;2;3;4;5,00:00:00
|
||||
OFFPEAK_EVENING,*any,*any,*any,1;2;3;4;5,19:00:00
|
||||
OFFPEAK_WEEKEND,*any,*any,*any,6;7,00:00:00
|
||||
OFFPEAK_WEEKEND,*any,*any,*any,6;7,00:00:00
|
||||
|
55
data/vagrant/Vagrantfile
vendored
55
data/vagrant/Vagrantfile
vendored
@@ -1,37 +1,38 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
||||
VAGRANTFILE_API_VERSION = "2"
|
||||
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
||||
# configures the configuration version (we support older styles for
|
||||
# backwards compatibility). Please don't change it unless you know what
|
||||
# you're doing.
|
||||
Vagrant.configure(2) do |config|
|
||||
# The most common configuration options are documented and commented below.
|
||||
# For a complete reference, please see the online documentation at
|
||||
# https://docs.vagrantup.com.
|
||||
|
||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
# All Vagrant configuration is done here. The most common configuration
|
||||
# options are documented and commented below. For a complete reference,
|
||||
# please see the online documentation at vagrantup.com.
|
||||
|
||||
# Every Vagrant virtual environment requires a box to build off of.
|
||||
config.vm.box = "debian74_64"
|
||||
config.vm.box_url = "https://s3-eu-west-1.amazonaws.com/ffuenf-vagrant-boxes/debian/debian-7.4.0-amd64_virtualbox.box"
|
||||
config.vm.network :public_network
|
||||
# Every Vagrant development environment requires a box. You can search for
|
||||
# boxes at https://atlas.hashicorp.com/search.
|
||||
config.vm.box = "debian83_64"
|
||||
config.vm.box_url = "https://s3.eu-central-1.amazonaws.com/ffuenf-vagrantboxes/debian/debian-8.3.0-amd64_virtualbox.box"
|
||||
|
||||
# Disable automatic box update checking. If you disable this, then
|
||||
# boxes will only be checked for updates when the user runs
|
||||
# `vagrant box outdated`. This is not recommended.
|
||||
# config.vm.box_check_update = false
|
||||
|
||||
# Create a forwarded port mapping which allows access to a specific port
|
||||
# within the machine from a port on the host machine. In the example below,
|
||||
# accessing "localhost:8080" will access port 80 on the guest machine.
|
||||
# config.vm.network :forwarded_port, guest: 80, host: 8080
|
||||
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
||||
|
||||
# Create a private network, which allows host-only access to the machine
|
||||
# using a specific IP.
|
||||
# config.vm.network :private_network, ip: "192.168.33.10"
|
||||
# config.vm.network "private_network", ip: "192.168.33.10"
|
||||
|
||||
# Create a public network, which generally matched to bridged network.
|
||||
# Bridged networks make the machine appear as another physical device on
|
||||
# your network.
|
||||
# config.vm.network :public_network
|
||||
|
||||
# If true, then any SSH connections made will enable agent forwarding.
|
||||
# Default value: false
|
||||
# config.ssh.forward_agent = true
|
||||
config.vm.network "public_network"
|
||||
|
||||
# Share an additional folder to the guest VM. The first argument is
|
||||
# the path on the host to the actual folder. The second argument is
|
||||
@@ -43,16 +44,24 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
# backing providers for Vagrant. These expose provider-specific options.
|
||||
# Example for VirtualBox:
|
||||
#
|
||||
# config.vm.provider :virtualbox do |vb|
|
||||
# # Don't boot with headless mode
|
||||
# config.vm.provider "virtualbox" do |vb|
|
||||
# # Display the VirtualBox GUI when booting the machine
|
||||
# vb.gui = true
|
||||
#
|
||||
# # Use VBoxManage to customize the VM. For example to change memory:
|
||||
# vb.customize ["modifyvm", :id, "--memory", "1024"]
|
||||
# # Customize the amount of memory on the VM:
|
||||
# vb.memory = "1024"
|
||||
# end
|
||||
#
|
||||
# View the documentation for the provider you're using for more
|
||||
# View the documentation for the provider you are using for more
|
||||
# information on available options.
|
||||
|
||||
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
|
||||
# such as FTP and Heroku are also available. See the documentation at
|
||||
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
|
||||
# config.push.define "atlas" do |push|
|
||||
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
|
||||
# end
|
||||
|
||||
config.vm.provision "ansible" do |ansible|
|
||||
ansible.playbook = "cgrates_devel.yml"
|
||||
#ansible.verbose = "vvvv"
|
||||
|
||||
1
data/vagrant/cgrates_devel.retry
Normal file
1
data/vagrant/cgrates_devel.retry
Normal file
@@ -0,0 +1 @@
|
||||
default
|
||||
@@ -1,76 +1,74 @@
|
||||
---
|
||||
|
||||
- hosts: all
|
||||
user: vagrant
|
||||
sudo: yes
|
||||
become: true
|
||||
vars:
|
||||
root_db_password: CGRateS.org
|
||||
|
||||
tasks:
|
||||
- name: install dependency
|
||||
apt: pkg={{ item }} state=latest
|
||||
with_items:
|
||||
- git
|
||||
- bzr
|
||||
- redis-server
|
||||
- mysql-server
|
||||
- python-pycurl
|
||||
- python-mysqldb
|
||||
- mercurial
|
||||
|
||||
- name: add cgrates user
|
||||
user: name=cgrates comment=CGRateS home=/var/run/cgrates shell=/bin/false system=yes
|
||||
|
||||
- name: add freeswitch gpg key
|
||||
command: gpg --keyserver pool.sks-keyservers.net --recv-key D76EDC7725E010CF
|
||||
|
||||
- name: add freeswitch apt key
|
||||
shell: gpg -a --export D76EDC7725E010CF | sudo apt-key add -
|
||||
apt_key: url=https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub state=present
|
||||
|
||||
- name: add freeswitch apt repo
|
||||
apt_repository: repo='deb http://files.freeswitch.org/repo/deb/debian/ wheezy main' state=present
|
||||
|
||||
- name: install freeswitch
|
||||
apt_repository: repo='deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main' state=present
|
||||
|
||||
- name: add mongo gpg key
|
||||
apt_key: keyserver=keyserver.ubuntu.com id=EA312927 state=present
|
||||
|
||||
- name: add mongo apt repo
|
||||
apt_repository: repo='deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.2 main' state=present
|
||||
|
||||
- name: install dependency
|
||||
apt: pkg={{ item }} update_cache=yes state=latest
|
||||
with_items:
|
||||
- git
|
||||
- bzr
|
||||
- mercurial
|
||||
- redis-server
|
||||
- mysql-server
|
||||
- postgresql-9.4
|
||||
- mongodb-org
|
||||
- freeswitch-meta-vanilla
|
||||
- freeswitch-mod-json-cdr
|
||||
- libyuv-dev
|
||||
|
||||
- name: update mysql root password for root account
|
||||
mysql_user: name=root host=localhost password={{ root_db_password }}
|
||||
mysql_user: name=cgrates host=localhost password={{ root_db_password }}
|
||||
|
||||
- name: copy .my.cnf
|
||||
template: src=my.cnf dest=/root/.my.cnf mode=0600
|
||||
|
||||
- hosts: all
|
||||
user: vagrant
|
||||
- hosts: all
|
||||
vars:
|
||||
root_db_password: CGRateS.org
|
||||
go_version: 1.3
|
||||
go_version: 1.6
|
||||
|
||||
tasks:
|
||||
- name: get golang
|
||||
get_url: url=https://storage.googleapis.com/golang/go{{ go_version }}.linux-amd64.tar.gz dest=~/go{{ go_version }}.linux-amd64.tar.gz
|
||||
|
||||
- name: unpack go
|
||||
command: chdir=~/ tar xvf go{{ go_version }}.linux-amd64.tar.gz
|
||||
|
||||
- name: delete golang archive
|
||||
file: path=~/go{{ go_version }}.linux-amd64.tar.gz state=absent
|
||||
unarchive: src=https://storage.googleapis.com/golang/go{{ go_version }}.linux-amd64.tar.gz dest=~/go creates=~/go copy=no
|
||||
|
||||
- name: add variables to variables /etc/profile
|
||||
copy: src=golang.sh dest=/etc/profile.d/golang.sh
|
||||
sudo: yes
|
||||
become: yes
|
||||
|
||||
- name: get cgrates
|
||||
shell: GOROOT=~/go GOPATH=~/code ~/go/bin/go get -u -v github.com/cgrates/cgrates
|
||||
git: repo=https://github.com/cgrates/cgrates.git dest=/home/vagrant/code/src/github.com/cgrates/cgrates
|
||||
|
||||
- name: get glide
|
||||
shell: GOROOT=/home/vagrant/go GOPATH=/home/vagrant/code ~/go/bin/go get -u -v github.com/Masterminds/glide
|
||||
|
||||
- name: install cgrates
|
||||
shell: cd /home/vagrant/code/src/github.com/cgrates/cgrates; ~/code/bin/glide install
|
||||
|
||||
- name: create cgr-engine link
|
||||
file: src=/home/vagrant/code/bin/cgr-engine dest=/usr/bin/cgr-engine state=link
|
||||
sudo: yes
|
||||
become: yes
|
||||
|
||||
- name: create a link to data dir
|
||||
sudo: yes
|
||||
become: yes
|
||||
file: src=/home/vagrant/code/src/github.com/cgrates/cgrates/data dest=/usr/share/cgrates state=link
|
||||
|
||||
- name: expand freeswitch json conf
|
||||
|
||||
Reference in New Issue
Block a user