Wiki

Clone wiki

SimwoodAPI / Voice / CDR

Back to index

Voice - CDR

Fetch account CDR data.

#!php
<?php
/**
 * @param int $account_id   - The account id which is provided to you by simwood
 * @param array $data       - Filter CDR data
 * @return object
 */

$simwood->voice->cdr($account_id, [
    'date_start' => 'YYYY-MM-DD H:i:s', //date time string
    'date_end' => 'YYYY-MM-DD H:i:s',   //date time string
    'limit' => '500',                   //int results to be returned
    'start' => '',                      //offset for pagination
    'filter' => [                       //filtering:
            'search_key' => 'value'     // supported keys are from, to, toISO, trunk, tag
    ],
]);

Result:

#!txt

stdClass Object
(
    [success] => 1
    [count] => 1
    [data] => Array
    (
        [0] => stdClass Object
            (
                [_id] => 22285b6b71602935605072b3ffc083101ad23123
                [time] => 13:27:19
                [date] => 2015-12-10
                [account] => 930825
                [fromdesc] => NTS
                [from] => 01234567890
                [to] => 441234567890
                [toid] => 2523
                [toISO] => GB
                [todesc] => NTS to VoIP
                [calldate] => 2015-12-10 13:27:00
                [secs_call] => 3
                [secs_peak] => 3
                [secs_offpeak] => 0
                [secs_weekend] => 0
                [secs_billed] => 3
                [rate_peak] => 0.00000
                [rate_offpeak] => 0.00000
                [rate_weekend] => 0.00000
                [rate_connection] => 0.0000
                [chg_total] => 0
                [currency] => GBP
                [trunk] => 930000-L001
                [tag] =>
                [reference] => 22285b6b71602935605072b3ffc083101ad23123
        )
        ...
    )
)

Voice - CDR - Details

Fetch account specific CDR data.

#!php
<?php
/**
 * @param int $account_id   - The account id which is provided to you by simwood
 * @param array $data       - Filter CDR data
 * @return object
 */

$simwood->voice->cdrDetails($account_id, 'YYYY-MM-DD', '22285b6b71602935605072b3ffc083101ad23123');

Result:

#!txt

stdClass Object
(
    [success] =>
    [http_code] => 500
    [errors] => Array
    (
        [0] => Temporarily Unavailable
    )

)

Updated