Initiate a call to the PSTN:
Method to initiate a call to the PSTN. You have to provide two phone numbers. In the first step the destination_number will be called. As soon as this call is answered, the tenios_number will be called and the assigned routing plan is executed. If you have provided a callstate_info_url, a HTTPS POST request with callstate information we be sent on every call status change. If you configure a routingplan with an API Routing Control Block for the tenios_number , you will see the id returned by the makecall/init request in the variable callback_id. Furthermore you will see the uuid of the call to the tenios_number in the variable callback_bleg_uuid.
Example:
{ "requestType": "EXTERNAL_CALL_CONTROL", "customerNumber": 200002, "accessKey": "XXXX-XXXX-XXXXX", "variables": { "callback_bleg_uuid": "615dab09-1a48-4e61-8a0d-9244251cfe6d", "destination_number": "+492215540030", "callback_id": "66195", "correlation_id": "7bb824c4-cc20-11ea-90f0-57d7f6704fca", "call_uuid": "7bb824c4-cc20-11ea-90f0-57d7f6704fca", "caller_id_number": "+492215540030" }, "callControlUuid": "46250866-066f-4226-85a4-4047270b32e9", "loopCount": 0, "requestStatus": "REQUESTING_BLOCKS", "blocksProcessingResult": null }
POST | https://api.tenios.com/makecall/init |
Request Parameter:
access_key String | The API Access Key. It can be found in the menu MY ACCOUNT -> General Settings in the section API in the customer portal |
destination_number String | The destination number of the call you want to establish. |
tenios_number String | The service number in your account where the call is bridged to after the call is connected to the destination_number. |
caller_id String Optional | The caller_id which should be signalled. It is possible to use all phone numbers which are assignes to your TENIOS account (plus max. 5-digit Extension). |
callstate_info_url String Optional | An URL (HTTPS) which is posted on call state changes with information about the current call status. |
destination_origination_timeout Integer Optional | The number of seconds until the origination timeout (e.g. ring time) at the destination. This can be set from 5 to 120 seconds. |
Example 2: (incl. destination_origination_timeout)
{ "requestType": "EXTERNAL_CALL_CONTROL", "customerNumber": 200002, "accessKey": "XXXX-XXXX-XXXXX", "variables": { "callback_bleg_uuid": "615dab09-1a48-4e61-8a0d-9244251cfe6d", "destination_number": "+492215540030", "callback_id": "66195", "correlation_id": "7bb824c4-cc20-11ea-90f0-57d7f6704fca", "call_uuid": "7bb824c4-cc20-11ea-90f0-57d7f6704fca", "caller_id_number": "+492215540030", "destination_origination_timeout": "60" }, "callControlUuid": "46250866-066f-4226-85a4-4047270b32e9", "loopCount": 0, "requestStatus": "REQUESTING_BLOCKS", "blocksProcessingResult": null }
Response Parameter:
id | The Id of the makecall request. This Id will be provided in the call status information if an callstate_info_url was stated. |
Parameter passed in the JSON of the requests to the callstate_info_url:
callback_id | The id of the callback that generated this call. |
call_uuid | The uuid of the call. |
callback_a_number | The A number of the callback, e.g the call leg that is called first. |
callback_b_number | The B number of the callback, e.g. the call leg which is called when the A leg gets connected. |
call_leg | Indicates the leg of the callback. Can be A_LEG or B_LEG. |
destination_number | The destination number of the make call request. |
callerid | The callerid of this call leg |
dialstatus | The current status of the call. possible values are:
|
Example of a successful request:
Request:
{ "access_key": "XXXXX-XXXX-XXXXXX", "destination_number": "+4922155400300", "tenios_number": "+4922155400300", "callstate_info_url": "https://myserver.com/callstate" }
API-Response:
HTTP Status Code: 200 (OK)
{ "id": 10 }