Billing, Charging and Call Records APIs

TringMe platform including VoicePHP is completely free. In most cases, TringMe only charges for the phone calls. However, if none of the leg is over phone, we need to at least charge minimum just to meet the infrastructure cost and resource utilization. All such calls will be charged at the rate 1 sipcredits/minute.

SIP credits can be purchased from TringMe website or in bulk by contacting us. All Conference call and SIP legs will always be charged at the rate 1 sipcredit/minute irrespective of other legs

Simultaneous Calls

TringMe’s platform allows placing unlimited simultaneous calls; only limited by credit balance. By default, TringMe reserves credits for 90 minutes before placing the call. These ‘reserved’ credits are freed once the call ends and only the charges for the actual duration of the call are applied to the user.

The default ‘reserved’ credits can be over-ridden by specifying the ‘duration’ parameter in ‘call’ or Flash APIs in which case the credits reserved will be only for the specified duration only.

Conference Charges

Conference charges are as follows:

  • Each Conference Charge: $1 USD for first hour, 0.25USD per hour thereafter.
  • Usage charge: 1 sip credit per participant per minute.
  • If used with callback facility, phone charges as actuals.

If you plan to use for larger quantity, we recommend our private switch. Please contact us for further details on this.


Retrieving Call Records

Access to complete billing and call-records is provided by using this API. The call-record includes all the relevant call-details (phone number, call- duration, time, call-tag etc.). It returns the data in JSON format.

Parameters
op getcdr
cookie Cookie which was obtained using ‘login’.
id [optional] All call records greater than specified ‘id’ will be retrieved.
starttime [optional] Starting time from which the call records should be retrieved. This should be specified in seconds relative to the time of invocation.
endtime [optional] Ending time till which the call records should be retrieved. This should be specified in seconds relative to the time of invocation.
tag [optional] If tag is specified, then call records matching that tag are retrieved. Wildcards (*, ?) are supported to retrieve matching call records as well.
Sample Request URL
http://api.tringme.com/api.php?op=getcdr&cookie= 12345678901234567890 12345678901&json=1 &apikey=b1234567890123456789 0123456789012345 &sig=f1234567890123456789 012345678901
Expected Response
'OKJ' alongwith call records of completed calls in JSON format. The timestamp of the call records will be in seconds relative to the time of invocation of the API.Following are the‘type’s of records that will be returned.:
Type Description
0 Call
1 SMS
2 Amount transferred using ‘setphonecredits’ API
3 SIP Credits Purchase
4 SIP
5
6 Conference
Sample Responses
OKJ
[{"id":"12382", "phone":"18585551212", "duration":"4", "charges":"0.0120", "type":"0", "calltag":"", "calltime":"15365"}, {"id":"12355", "phone":"441234567890", "duration":"3", "charges":"0.0100", "type":"0", "calltag":"", "calltime":"141335"}, {"id":"12345", "phone":"911234567890", "duration":"0", "charges":"0.0400", "type":"1", "calltag":"", "calltime":"152396"}]

Retrieving Files (Recordings, Voicemails etc.)

Retrieve file from TringMe infrastructure. The file may be deleted once retrieved and hence should be stored by the invoker. Any file that is newly made available to the system (for e.g. a file recorded using VoicePHP ‘record’ or a newly received voicemail) will be available for download for a maximum period of 72 hours, after which it may be deleted.

Parameters
op getfile
id File ‘id’ as returned by VoicePHP ‘record’ API or ‘getvoicemail’.
Sample Request URL
http://api.tringme.com/api.php?op=getcdr&cookie= 123456789012345678 9012345678901&json=1 &apikey=b1234567890123456 7890123456789012345 &sig=f12345678901234567 89012345678901
Expected Response
OK
Sample Responses
OK

Notification URL

TringMe also provides a notification mechanism whereby developers can listen for notifications to retrieve call details including call-duration, total charges, call-tag and so on. API holder can listen to these notifications and do the appropriate mark-up processing before inserting the call-related information in their database.

Parameters
op setnotifyurl
url URL where notifications should be sent.
flag [optional] Reserved
Sample Request URL
http://api.tringme.com/api.php?op=setnotifyurl &url=http://somedomain.com &apikey=b123456789012345678 90123456789012345 &sig=f1234567890123456789 012345678901
Expected Response
OK
Sample Responses
OK

Setting Phone Credits In User Account

This API provides a way for an API account holder to transfer credits to the user’s account.

Parameters
op setphonecredits
amount Amount in USD that should be transferred. In case of private user, negative amount can be specified. It will debit the amount from the user account and credit it to API holder account.
cookie [optional] Cookie which was obtained using ‘login’.
email [optional] Email address of the user. This is only required in case of private account and if ‘cookie’ is omitted.
private [optional] Private user. This specifies if the user to whose account the credits are being set is private. This will only be used if ‘email’ has been specified.
Sample Request URL
http://api.tringme.com/api.php ?op=setphonecredits &amount=1.0&apikey=b123456789012345678 90123456789012345 &sig=f123456789012345678 9012345678901
Expected Response
OK ‘<transaction number>’
The <transaction number> is only meant for reference purposes.
Sample Responses
OK 890123456789012345678901

Buy SIP Credits

This API provides a way for an user to transfer credits to sip.

Parameters
op buysipcredits
amount Amount in USD that should be transferred. In case of private user, negative amount can be specified. It will debit the amount from the user account and credit it to API holder account.
cookie [optional] Cookie which was obtained using ‘login’.
Sample Request URL
http://api.tringme.com/api.php? op=buysipcredits &amount=1.0 &apikey=b123456789012345678 90123456789012345 &sig=f123456789012345 6789012345678901
Expected Response
OK
Sample Responses
OK

Getting Phone and SMS Rates

This API provides a way to get the call and SMS rates for a specific or comma seperated list of phone numbers.

Parameters
op getrates
dest Phone number for which rates are required. It can be specified as a partial phone number too (for e.g. 44991 would retrieve rates for UK).
Sample Request URL
http://api.tringme.com/api.php ?op=getrates &dest=15015551234 &apikey=b1234567890123456789 0123456789012345 &sig=f1234567890123 456789012345678901
Expected Response
OKJ <json formated charge information>
Sample Responses
OKJ
{"phone":"15015551234", "destination":"United States", "rate":1.3,"rate2":1.2, "slotdur":15,"smsrate":7, "smsdestination":"United States"}

Getting either Phone or SMS Rates

This API provides a way to get the call or SMS rate for a specific phone number.

Parameters
op getrates
dest Phone number for which rates are required. It can be specified as a partial phone number too (for e.g. 44991 would retrieve rates for UK).
type [optional] Type of rate requested. 0 specifies phone rate and 1 specifies SMS rate. The default value is 0.
Sample Request URL
http://api.tringme.com/api.php?op=getrate &dest=15015551234 &apikey=b1234567890123456789 0123456789012345 &sig=f1234567890123456 789012345678901
Expected Response
OK <charge in cents> <location to which number belongs>
Sample Responses
OK 1.3 United States

If you are an enterprise and would like to know better how TringMe can help you reduce cost and at the same time benefit you,
please send a mail to bizdev@tringme.com