Updated cgrates.json

This commit is contained in:
Trial97
2018-10-31 14:12:56 +02:00
committed by Dan Christian Bogos
parent 28f9d335da
commit 765950daba
5 changed files with 669 additions and 663 deletions

View File

@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package config
import (
"strings"
"time"
"github.com/cgrates/cgrates/utils"
@@ -29,7 +30,7 @@ type CdrcCfg struct {
Enabled bool // Enable/Disable the profile
DryRun bool // Do not post CDRs to the server
CdrsConns []*HaPoolConfig // The address where CDRs can be reached
CdrFormat string // The type of CDR file to process <csv|opensips_flatstore>
CdrFormat string // The type of CDR file to process <*csv|*opensips_flatstore>
FieldSeparator rune // The separator to use when reading csvs
DataUsageMultiplyFactor float64 // Conversion factor for data usage
Timezone string // timezone for timestamps where not specified <""|UTC|Local|$IANA_TZ_DB>
@@ -73,7 +74,7 @@ func (self *CdrcCfg) loadFromJsonCfg(jsnCfg *CdrcJsonCfg) error {
}
}
if jsnCfg.Cdr_format != nil {
self.CdrFormat = *jsnCfg.Cdr_format
self.CdrFormat = strings.TrimPrefix(*jsnCfg.Cdr_format, "*")
}
if jsnCfg.Field_separator != nil && len(*jsnCfg.Field_separator) > 0 {
sepStr := *jsnCfg.Field_separator

View File

@@ -33,7 +33,7 @@ const CGRATES_CFG_JSON = `
"log_level": 6, // control the level of messages logged (0-emerg to 7-debug)
"http_skip_tls_verify": false, // if enabled Http Client will accept any TLS certificate
"rounding_decimals": 5, // system level precision for floats
"dbdata_encoding": "msgpack", // encoding used to store object data in strings: <msgpack|json>
"dbdata_encoding": "*msgpack", // encoding used to store object data in strings: <*msgpack|*json>
"tpexport_dir": "/var/spool/cgrates/tpe", // path towards export folder for offline Tariff Plans
"poster_attempts": 3, // number of attempts before considering post request failed (eg: *call_url, CDR replication)
"failed_posts_dir": "/var/spool/cgrates/failed_posts", // directory path where we store failed requests
@@ -245,7 +245,7 @@ const CGRATES_CFG_JSON = `
"cdrs_conns": [
{"address": "*internal"} // address where to reach CDR server. <*internal|x.y.z.y:1234>
],
"cdr_format": "csv", // CDR file format <csv|freeswitch_csv|fwv|opensips_flatstore|partial_csv>
"cdr_format": "*csv", // CDR file format <*csv|*freeswitch_csv|*fwv|*opensips_flatstore|*partial_csv>
"field_separator": ",", // separator used in case of csv files
"timezone": "", // timezone for timestamps where not specified <""|UTC|Local|$IANA_TZ_DB>
"run_delay": 0, // sleep interval in seconds between consecutive runs, 0 to use automation via inotify

View File

@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package config
import (
"strings"
"time"
"github.com/cgrates/cgrates/utils"
@@ -66,7 +67,7 @@ func (gencfg *GeneralCfg) loadFromJsonCfg(jsnGeneralCfg *GeneralJsonCfg) (err er
}
if jsnGeneralCfg.Dbdata_encoding != nil {
gencfg.DBDataEncoding = *jsnGeneralCfg.Dbdata_encoding
gencfg.DBDataEncoding = strings.TrimPrefix(*jsnGeneralCfg.Dbdata_encoding, "*")
}
if jsnGeneralCfg.Default_request_type != nil {
gencfg.DefaultReqType = *jsnGeneralCfg.Default_request_type

View File

@@ -18,6 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package config
import (
"strings"
)
type MigratorCgrCfg struct {
OutDataDBType string
OutDataDBHost string
@@ -40,7 +44,7 @@ func (mg *MigratorCgrCfg) loadFromJsonCfg(jsnCfg *MigratorCfgJson) (err error) {
return
}
if jsnCfg.Out_dataDB_type != nil {
mg.OutDataDBType = *jsnCfg.Out_dataDB_type
mg.OutDataDBType = strings.TrimPrefix(*jsnCfg.Out_dataDB_type, "*")
}
if jsnCfg.Out_dataDB_host != nil {
mg.OutDataDBHost = *jsnCfg.Out_dataDB_host
@@ -58,7 +62,7 @@ func (mg *MigratorCgrCfg) loadFromJsonCfg(jsnCfg *MigratorCfgJson) (err error) {
mg.OutDataDBPassword = *jsnCfg.Out_dataDB_password
}
if jsnCfg.Out_dataDB_encoding != nil {
mg.OutDataDBEncoding = *jsnCfg.Out_dataDB_encoding
mg.OutDataDBEncoding = strings.TrimPrefix(*jsnCfg.Out_dataDB_encoding, "*")
}
if jsnCfg.Out_dataDB_redis_sentinel != nil {
mg.OutDataDBRedisSentinel = *jsnCfg.Out_dataDB_redis_sentinel

File diff suppressed because it is too large Load Diff