Strings, in particular call IDs, that are coming from Redis are not
necessarily valid UTF-8 since Redis doesn't really do UTF-8. The MySQL
DB schema expects strings in valid UTF-8 however (even though call IDs
really should be raw binary strings), resulting in an error if an
UTF-8 invalid string is attempted to be inserted.
Solve this by verifying each string's UTF-8 correctness before inserting
it, and forcing it to be interpreted as the 100% permissive latin1
charset if it isn't.
Change-Id: I5a218083bc4e3d7a47d1f77911f7ef9a88ce9bd2
To prepare for a second kind of CDR records, we refactor the SQL batch
string handling to include the statement definition and data queues in
the string object, and stop passing them around as arguments everywhere.
Change-Id: I2e3b278e859ce0cc22e7827c91d284b39fc34ecc
* type=id values are pre-fetched from cdr_tag_data on init
* 3 new data columns are stored in cdr_tag_data
furnished_charing_info,
header=P-Asserted-Identity
header=Diversion
Change-Id: I228743beb05cc09cc28d7df8dedc90dd3cdbcfed
* Fetch acc records both from mysql and redis
* Backup/trash redis acc records into mysql
* Introduce loglevel config option and log macros
Change-Id: I9bc55ed72502feaff03550c99ce481aea33e5e58
In parsing config options, it might be possible that an option is
provided more than once, where the allocated string buffer is then
overwritten without being free'd.
When copying call codes, assume a fixed length size of 3.
Check return code of open() when opening /dev/null for std* re-
directs.
Fixed spaces vs tabs in intendations.
Use fropen() for daemonization.
Refactor medmysql_fetch_callids to return malloc'd array.
Change-Id: I51ab7ebc01bdd747c8b5bb320998a5c13d64009e
Revert logic to pick peer id from stop record. This needs a better
approach somehow.
Instead, add logic to always take -pbx_1 and -xfer_1 stop records
into account when searching for stop records, to fix duration of
CDRs on transfer and park/unpark (which is just a special case
of transfer).
Change-Id: Ia80add6d5cb762800c563889c0d95ee25ed74168
When enabled, mediator will look for acc records belonging to the
$ci_pbx-1 call leg and use the stop/bye records from this call leg in
place of the regular one.
Change-Id: I46d326fb30fcf105642d188a07ae771a659ff17f
- Calls info (call_code, period) data is accumulated into $stats_db.'call_info'
table on the cdr insert
- Add stats_db and stats_period options (1=hour, 2=day, 3=month)
Change-Id: I4e1f7655eebfbe45a43e2c34d9c3b3bffe05fb40
Squashed commit of the following:
commit e137454f9d871332ef055b3de8eb9c703caece03
Author: Richard Fuchs <rfuchs@sipwise.com>
Date: Fri Jul 25 11:03:17 2014 -0400
MT#8195 lookup peer host ID against peer group/contract ID
commit 47e3509e634d9892fc1e2bc8111df6a90416addc
Author: Richard Fuchs <rfuchs@sipwise.com>
Date: Fri Jul 18 11:03:23 2014 -0400
MT#8195 use dst_leg peer id