Dev License: This installation of WHMCS is running under a Development License and is not authorized to be used for production use. Please report any cases of abuse to abuse@whmcs.com

API CDR Functions Print

  • 0


CDR FUNCTIONS
The following table explains the additional parameters needed by the CDR Functions and provides an example of their output when status is 'success'.


getCallAccounts
Parameters
client     => ID for a specific Reseller Client (Example: 561115)
Output
Array
(
    [status] => success
    [accounts] => Array
        (
            [0] => Array
                (
                    [value] => all
                    [description] => All Accounts
                )

            [1] => Array
                (
                    [value] => 100000_VoIP
                    [description] => 100000_VoIP
                )
        )
)
                            
getCallBilling
Parameters
No Parameter
Output
Array
(
    [status] => success
    [call_billing] => Array
        (
            [0] => Array
                (
                    [value] => all
                    [description] => All Calls
                )

            [1] => Array
                (
                    [value] => free
                    [description] => Free Calls
                )

            [2] => Array
                (
                    [value] => billed
                    [description] => Billed Calls
                )
        )
)
                            
getCallTypes
Parameters
client     => ID for a specific Reseller Client (Example: 561115)
Output
Array
(
    [status] => success
    [call_types] => Array
        (
            [0] => Array
                (
                    [value] => all
                    [description] => All Calls
                )

            [1] => Array
                (
                    [value] => outgoing
                    [description] => Outgoing Calls
                )

            [2] => Array
                (
                    [value] => incoming
                    [description] => Incoming Calls
                )

            [3] => Array
                (
                    [value] => 5551234567
                    [description] => Calls to 5551234567
                )
        )
)
                            
getCDR
Parameters
date_from     => [Required] Start Date for Filtering CDR (Example: '2010-11-30')
date_to       => [Required] End Date for Filtering CDR (Example: '2010-11-30')
answered      =>            Include Answered Calls to CDR (Boolean: 1/0)
noanswer      =>            Include NoAnswered calls to CDR (Boolean: 1/0)
busy          =>            Include Busy Calls to CDR (Boolean: 1/0)
failed        =>            Include Failed Calls to CDR (Boolean: 1/0)
timezone      => [Required] Adjust time of calls according to Timezome (Numeric: -12 to 13)
calltype      =>            Filters CDR by Call Type (Values from getCallTypes)
callbilling   =>            Filter CDR by Call Billing (Values from getCallBilling)
account       =>            Filter CDR by Account (Values from getCallAccounts)
                            
Output
Array
(
    [status] => success
    [cdr] => Array
        (
            [0] => Array
                (
                    [date] => 2010-11-30 10:40:16
                    [callerid] => "John Doe" <5551112222>
                    [destination] => 5551234567
                    [description] => Inbound - Local Caller
                    [account] => 100000_VoIP
                    [disposition] => ANSWERED
                    [duration] => 00:00:11
                    [seconds] => 11
                    [rate] => 0.00000000
                    [total] => 0.00000000
                    [uniqueid] => 128238059
                )

            [1] => Array
                (
                    [date] => 2010-09-30 10:36:32
                    [callerid] => "Jane Doe" <5551234567>
                    [destination] => 5551112222
                    [description] => Outbound - Customer
                    [account] => 100000_VoIP
                    [disposition] => ANSWERED
                    [duration] => 00:00:55
                    [seconds] => 55
                    [rate] => 0.00000000
                    [total] => 0.00000000
                    [uniqueid] => 128236206
                )
        )
)
                            
getRates
Parameters
package     => [Required] ID for a specific Package (Example: 92364)
query       => [Required] Query for searching rates (Example: 'Canada')
                            
Output
Array
(
    [status] => success
    [rates] => Array
        (
            [0] => Array
                (
                    [destination] => Canada - 418 Quebec City
                    [prefix] => 1418
                    [client_increment] => 60
                    [client_rate] => 0.015
                    [real_increment] => 6
                    [real_rate] => 0.0052
                )

            [1] => Array
                (
                    [destination] => Canada - 581 Quebec City
                    [prefix] => 1581
                    [client_increment] => 60
                    [client_rate] => 0.015
                    [real_increment] => 6
                    [real_rate] => 0.0052
                )
        )
)
                            
getTerminationRates
Parameters
route   => [Required] Route Code (Values from getRoutes)(Example: '2')
query   => [Required] Query for searching rates (Example: 'Canada')
                            
Output
Array
(
    [status] => success
    [route] => Array
        (
            [value] => 2 
            [description] => Premium    


        )
    [rates] => Array
        (
            [0] => Array
                (
                    [destination] => Canada - 204 Manitoba
                    [prefix] => 1204
                    [increment] => 6
                    [rate] => 0.009
                )

            [1] => Array
                (
                    [destination] => Canada - 418 Quebec City
                    [prefix] => 1418
                    [increment] => 6
                    [rate] => 0.009
                )
        )
)
                            
getResellerCDR
Parameters
date_from       => [Required] Start Date for Filtering CDR (Example: '2010-11-30')
date_to         => [Required] End Date for Filtering CDR (Example: '2010-11-30')
client          => [Required] ID for a specific Reseller Client (Example: 561115)
answered        =>            Include Answered Calls to CDR (Boolean: 1/0)
noanswer        =>            Include NoAnswered calls to CDR (Boolean: 1/0)
busy            =>            Include Busy Calls to CDR (Boolean: 1/0)
failed          =>            Include Failed Calls to CDR (Boolean: 1/0)
timezone        => [Required] Adjust time of calls according to Timezome (Numeric: -12 to 13)
calltype        =>            Filters CDR by Call Type (Values from getCallTypes)
callbilling     =>            Filter CDR by Call Billing (Values from getCallBilling)
account         =>            Filter CDR by Account (Values from getCallAccounts)
                            
Output
Array
(
    [status] => success
    [cdr] => Array
        (
            [0] => Array
                (
                    [date] => 2010-11-30 10:40:16
                    [callerid] => "John Doe" <5551112222>
                    [destination] => 5551234567
                    [description] => Inbound - Local Caller
                    [account] => 100000_VoIP
                    [disposition] => ANSWERED
                    [duration] => 00:00:11
                    [seconds] => 11
                    [total] => 0.015
                    [uniqueid] => 128238059
                )

            [1] => Array
                (
                    [date] => 2010-09-30 10:36:32
                    [callerid] => "Jane Doe" <5551234567>
                    [destination] => 5551112222
                    [description] => Outbound - Customer
                    [account] => 100000_VoIP
                    [disposition] => ANSWERED
                    [duration] => 00:00:55
                    [seconds] => 55
                    [total] => 0.015
                    [uniqueid] => 128236206
                )
        )
)
                            

Was this answer helpful?

« Back

Powered by WHMCompleteSolution