Click To Call
Overview
This service allows you to easily issue a clickToCall service between two phone numbers. Both calls are dialed, and upon answer, they are bridged together.
API
http://called.in/api/clicktocall/
https is also available
api_key: your api_key
caller_phone_number: 10-digit phone number of the person to call first, no spaces or dashes (ex: 5552104427)
caller_country_code: the country code (ex: north america is 1, UK is 44)
callee_phone_number: 10-digit phone number of the person will be called second, no spaces or dashes (ex: 5552104427)
callee_country_code: the country code (ex: north america is 1, UK is 44)
max_duration: the maximum call time in minutes before the call automatically ends. If left blank, there will be no time limit (ex: 5)
caller_id: you can specify the caller id to appear. The default caller id is the caller_phone_number (ex: 5552223333)
callback_url: URL that we will reply back to (see below)
secret: a string that will be included with the callback. This can be used as an identifier, or to prevent spoofing. Max 30 characters.
0: success. we will attempt call shortly
The following are error codes:
1: invalid api_key
2: no call credits
3: the phone_number is on the DoNotCall list
4: badly formed request. make sure all parameters match the above descriptions
5: api_key is currently disabled
6: flood protection for phone_number. please wait 1 minute and try request again
7: caller_phone_number area code is not supported at this time
8: caller_country_code is not supported
9: callee_phone_number area code is not supported at this time
10: callee_country_code is not supported
If a callback_url is provided, we will open the URL with the following GET parameters
caller_phone_number: the caller_phone_number that you provided, and was dialed
callee_phone_number: the callee_phone_number that you provided, and was dialed
minutes: the length of the phone call in minutes (can be 0 if the call was not connected)
secret: if you provided a 'secret' string, this will contain the same string. If not, this will be empty.
answered: a value of 0 if we could not connect call, or 1 if the call was answered.
reason: if the call was not answered, the reason will contain one of the following reasons:
0 - Failed (not busy or congested)
1 - Hung up
3 - Ring timeout
5 - Busy
8 - Congestion
Sample Code
<?php
$api_url = 'http://called.in/api/clicktocall/';
$api_key = 'your_api_key';
$caller_phone_number = '5551234444';
$caller_country_code = '1'; // North America
$callee_phone_number = '5551236666';
$callee_country_code = '1';
$max_duration = '3';
//issue the API call to Called.in
$return_code = file_get_contents("$api_url?api_key=$api_key&caller_phone_number=$phone_number&caller_country_code=$country_code&callee_phone_number=$callee_phone_number&callee_country_code=$callee_country_code&max_duration=$max_duration");
if($return_code != 0) {
// an error has occurred
//handle it in here
echo $return_code;
}
?>
Plugins & Libraries
Coming Soon!Pricing
For pricing information please click here.