This API make a call between an Endpoint/Extension and a Destination phone number.
You can Integrate the Click-to-Call API using our Cloud Services as well as your own Asterisk based PBX with our local connector installed.
Cloud IntegrationThis integration is the better way when you have a Cloud System and/or have no access to your PBX IP Address or just don't want open it to the internet.
When you have a local network and a single system, maybe you prefer point your API to the local PBX IP Address.
Your Local Asterisk PBX
Endpoint to this Request
|/call||Make a new call|
Yu can send the token on the Request in two different ways: in the Body as a key of the JSON object or in the Header.
In the Body you will send as a key/value like other parameters. The special key name for the it is token:
In the Header as an Authorization:
The Request can be POST, as an JSON Object in the Body, or GET, with url parameters.
For the POST Request you need keep the content-type Header set to application/json.
The parameters are:
Method POST with the Token in BODY:
Method POST with Token in HEADER:
The API address. In case you have a SNEP Server installed into your company, you need to do a Register into Opens Cloud enabling this service.
|from||String||required||The Agent Code ou Extension that are requesting the call.|
|to||String||required||Number to be called.|
|returnurl||String||optional||Callback URL to get back the call status. After the hangup the system will return it status in JSON format in the Body of the request using POST method.|
|timeout||Int(in seconds)||optional||This parameter indicate the time to try to connect with the number from, by default this time is 12 seconds. If the number from don't get the call, the API will return a event called lost-call to the callback url (returnurl).|
|force_from||yes | no||optional|
By default the call is realized differentiating a manual call from the click-to-call call adding 0000 prefix on the from key, changing the source of the call inside the asterisk to 0000XXXX, where XXXX is the original caller.
This parameter fix the source of request to the exact number, not adding 0000 as prefix.
Call Status Reply
If you informed the returnurl parameter, you will receive a API reply in the end of the call, like this:
|The Event type. In this case, "hangup", the call end.|
|The source for this call. In this case, "click-to-call", made from other system.|
|callid||Unique ID for the call. Used for call status and billing.|
|uniqueid||Internal ID for the main channel for this call.|
|linkedid||Internal ID for the linked channel for this call.|
|audio_file||Audio filename for the recorded call.|
|URL for the Audio Filename. This path need be completed by audio_url + audio_file|
|billsec||Conversation time for the call (in seconds).|
|Call duration time (in seconds).|
|The Caller data|
|The caller endpoint/extention.|
|callflow||The complete call flow inside of the PBX|
|hangupdate||End call Date and time|