Handle voice calls from client


Set the parameter voice_start on your client phonenumber to https://yourapp.example/elks/calls (or wherever your webhook code is). We'll make an HTTP POST request to this URL every time the client makes a call.


POST https://yourapp.example/elks/calls
Example payload

Request parameters

Parameter Description
callid The unique id of the call in the 46elks call API.
from The client number that initaed the call.
to The phone number that the client is calling.
created The time in UTC when the call object was created in our systems.

Sample code

$call = Array(
  "callerid"=> "+46766761004",
  "busy" => Array("play"=>"https://your_server/busy.mp3"),
  "failed" => Array("play"=>"https://your_server/failed.mp3")

print json_encode($call);

Response structure

You must respond with a valid JSON struct to allow the call to continue. For example:

  "connect": "+4634090510",
  "callerid": "+46700000000",
  "failed": {"play": "https://yourapp.example/callfailed.wav"}
  "busy": {"play": "https://yourapp.example/callbusy.wav"}

Your webhook code must respond with a HTTP status in the range 200-204. If not, the API will end the call.