-
Notifications
You must be signed in to change notification settings - Fork 14
/
cdr-pusher.yaml
119 lines (95 loc) · 3.95 KB
/
cdr-pusher.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# CDR FETCHING - SOURCE
# ---------------------
# storage_source_type: DB backend type where CDRs are stored
# (accepted values: "sqlite3" and "mysql")
storage_source: "sqlite3"
#
# If you use Mysql, please ensure that you have a Primary Key in your `cdr` table.
# You can create a Primary Key if one is missing using:
# ALTER TABLE cdr ADD COLUMN id int(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT FIRST;
#
# db_file: specify the database path and name
# for test we need db_file to be set at ./sqlitedb/cdr.db
db_file: "./sqlitedb/cdr.db"
# db_file: "/usr/local/freeswitch/cdr.db"
# db_file: "/opt/app/cdr-pusher/sqlitedb/cdr.db"
# Use this with Mysql!
# Database DNS (https://github.com/go-sql-driver/mysql#dsn-data-source-name)
# [username[:password]@][protocol[(address)]]/dbname[?param1=value1&...¶mN=valueN]
# eg. db_dns: "username:password@tcp(127.0.0.1:3306)/asterisk"
db_dns: ""
# db_table: the DB table name
db_table: "cdr"
# db_flag_field defines the field that will be used as table id (PK) (not used with Sqlite3)
db_id_field: "id"
# db_flag_field defines the table field that will be added/used to track the import
db_flag_field: "flag_imported"
# max_fetch_batch: Max amoun to CDR to push in batch (value: 1-1000)
max_fetch_batch: 100
# heartbeat: Frequency of check for new CDRs in seconds
heartbeat: 1
# cdr_fields is list of fields that will be fetched (from SQLite3) and pushed (to PostgreSQL)
# - if dest_field is callid, it will be used in riak as key to insert
cdr_fields:
- orig_field: uuid
dest_field: callid
type_field: string
- orig_field: caller_id_name
dest_field: caller_id_name
type_field: string
- orig_field: caller_id_number
dest_field: caller_id_number
type_field: string
- orig_field: destination_number
dest_field: destination_number
type_field: string
- orig_field: hangup_cause_q850
dest_field: hangup_cause_id
type_field: int
- orig_field: duration
dest_field: duration
type_field: int
- orig_field: billsec
dest_field: billsec
type_field: int
# - orig_field: account_code
# dest_field: accountcode
# type_field: string
- orig_field: "datetime(start_stamp)"
dest_field: starting_date
type_field: date
# - orig_field: "strftime('%s', answer_stamp)" # convert to epoch
- orig_field: "datetime(answer_stamp)"
dest_field: extradata
type_field: jsonb
- orig_field: "datetime(end_stamp)"
dest_field: extradata
type_field: jsonb
# CDR PUSHING - DESTINATION
# -------------------------
# storage_dest_type defines where push the CDRs (accepted values: "postgres" or "riak")
storage_destination: "postgres"
# Used when storage_dest_type = postgres
# datasourcename: connect string to connect to PostgreSQL used by sql.Open
pg_datasourcename: "user=postgres password=password host=localhost port=5432 dbname=cdr-pusher sslmode=disable"
# Used when storage_dest_type = postgres
# pg_store_table: the DB table name to store CDRs in Postgres
table_destination: "cdr_import"
# Used when storage_dest_type = riak
# riak_connect: connect string to connect to Riak used by riak.ConnectClient
riak_connect: "127.0.0.1:8087"
# Used when storage_dest_type = postgres
# riak_bucket: the bucket name to store CDRs in Riak
riak_bucket: "cdr_import"
# switch_ip: leave this empty to default to your external IP (accepted value: ""|"your IP")
switch_ip: ""
# cdr_source_type: write the id of the cdr sources type
# (accepted value: unknown: 0, csv: 1, api: 2, freeswitch: 3, asterisk: 4, yate: 5, kamailio: 6, opensips: 7, sipwise: 8, veraz: 9)
cdr_source_type: 0
# SETTINGS FOR FAKE GENERATOR
# ---------------------------
# fake_cdr will populate the SQLite database with fake CDRs for test purpose (accepted value: "yes|no")
fake_cdr: "no"
# fake_amount_cdr is the amount of CDRs to generate into the SQLite database for test purpose (value: 1-1000)
# this amount of CDRs will be created every second
fake_amount_cdr: 1000