There are 2 ways of fetching billing records/call detail records (CDR) from the Hero platforms. The first method is by utilising our Billing Feed Web Service which is available for all Hero accounts. The second method is a more traditional FTP collection process which is available to customers on demand.
Billing Feed Web Service
The URL for our Billing Feed is:
The parameters can be passed as a POST or GET (Post is given priority) as follows:
- login (required) - This is the username you connect with (e.g. 81234567) and may be the account number.
- password (required) - This is the password for the connecting login
- fromid (required) - This is the ID number you wish to download CDR from (greater than this ID). You should store the last ID number you downloaded and pass this as the fromid on your next query.
- format (optional) - The default format returned is CSV format. However the following formats are supported:
- csv - Comma Separated Values
- txt - Tab Separated Values
- pipe - Pipe '|' Separated Values
- json - JSON formatted Array returned
- date (optional) - You can optionally set a date you wish to search for in YYYY-MM-DD format (e.g. 2019-05-22)
- hour (optional) - You can optionally set an hour you wish to search for from 0 to 23. This must be used in conjuction with the date option.
- callsonly (optional) - If you set this to '1' then the billing feed will only return calls and not any 'service' fees such as number charges, broadband fees and other fixed/manual charges
- servicesonly (optional) - If you set this to '1' then the billing feed will only return 'service' fees such as number charges, broadband fees and other fixed/manual charges and no calls.
So for example in GET format the following URL would be valid if your account number was 81234567 and your password was Monkey123
If there is any billing records to return then the format of the rows will be as follows:
- ID: This is the identifier for the call and you should pass the maximum ID returned as the fromid on your next query
- AccountCode: The account number this billing record relates to
- Direction: The direction of the call (inbound, outbound or onnet if internal to Hero)
- CallType: The type of call made (e.g. Mobile, Local, International, SMS, Onnet etc.)
- BillDate: The billing date of the billing record (typically the bill cycle date)
- Date: The date of the billing record in NZ Local time
- Time: The time of the billing record in NZ Local time
- UTCDateTime: The date and time of the call in UTC time
- UTCOffset: The current offset in hours between UTC and Local time
- AParty: The calling number for this call
- BParty: The called number for this call
- BillNumber: The number which has been billed for this call (this could be different to the AParty for call diversions etc.)
- Seconds: Number of seconds charged for this call. (NOTE: Calls may be rounded up to the next minute)
- NetworkSeconds: The actual number of connected seconds this call was up for
- ConnectSeconds: How many seconds it took to connect this call
- Charge: The charge amount including GST for this call
- ChargeExcl: The charge amount excluding GST for this call
- FreeUnitsUsed: How many free units were used for this call (if the call was made as part of a calling bundle)
- TextDesc1: Textual Description of the call
- TextDesc2: More detailed description of the call
- ReleaseCause: The ISDN (ISUP) release cause for the call. e.g. 0017 = Busy
- Status: A simpler description of the release cause for the call (Ok, Busy, No Answer, Unallocated, Error etc.)
- ServiceType: The service type identifier associated with this call (i.e. the calling plan identifier)
- BillingGroup: The billing group associated with the line if specified (otherwise it will be Default)
- CallingGroup: The calling group associated with the line if specified (otherwise it will be Default)
- Profile: The profile associated with the line if specified (otherwise it will be Default)
NOTE: Please do not fetch ALL call records when using the web service. You should always pass the fromid as the ID to start searching from (unless it is the first query in which case you can use fromid=1). Please do not excessively query the Billing Feed process. A reasonable polling frequency would be 10 minutes or greater.
FTP Method for CDR Collection
Our Secure FTP method for CDR collection is only available to those customers that request this service. Please contact email@example.com if you need to fetch the CSV files using an FTP process and provide the following information:
- Which IP address(es) do you wish to download the CDR from?
- Can you support Secure FTP (SFTP)?
- Do you wish to use username/password for authentication or a SSH key? If the latter then can you send us your public key?
- Which format do you want the CDR to be produced in (Options are CSV, Tab Separated, Pipe Separated or JSON format)
- How frequently do you want CDR files produced? Options are daily, hourly or every 20 minutes.
The format of the results will be the same as those specified above in the web services feed.
Please contact our team at firstname.lastname@example.org if you have any further questions.Tags: Billing, CDR, FTP