Webhook call routing

Redirecting the calls into your CRM-system

If the CRM-system allows taking the calls within it, set up the call routing using webhooks. Once installed, the call routing via webhooks will allow Ringostat to send HTTP(S)-request to a CRM-system and get a phone number or a SIP login as a reply. Then the system redirects the call to this location. At the end of the path, the agent will be able to answer the incoming call right in the CRM-system account.

The call parameters come in two ways:

  • HTTP(S) titles;
  • JSON-format.

First, create the scheme and set the name for it. Then click on “Edit” button and enter the next details:

  • URL;
  • HTTP request method;
  • Data submission type;
  • Data import type;
  • Name in response for destination (for JSON);
  • A timeout of the call to forwarding phone number, in seconds;

URL is an address of your CRM-system or another source, you are going to send the request for the call direction information to.

There are several sending methods you can use:

  • GET;
  • POST;
  • PUT;
  • DELETE.

Please note: use the method your CRM-system or the source requires.

For the Data submission type and Data import type enter HTTP(S)- or JSON-types.

Please note: the system automatically set POST as a sending method for the JSON-format.

In the Name in response field for the destination (for JSON) enter the name of the location parameter. The call will be redirected to this location according to this parameter and its value.

Set the max timeout for waiting for a response from our server (in seconds).

Add Webhook parameters according to the CRM-system configurations and save.

Example of request

method - POST, data type - json url

POST /api/addnumber/ HTTP/1.1

Host: api.asterisk

Origin: api.asterisk

User-Agent: ringostat HTTP Client v1.1

Content-Type: application/json

Content-Length: 128

Connection: close

{"call_id":"pkv","step_forward":"webhookNumber%3A120","uuid":"842d921d-5334-4eca-812d-9a478dc8c884","google_id":"UA-38222689-2"}

Examples of response

json type:

HTTP/1.1 200 OK

Server: nginx/1.6.3

Date: Wed, 09 Dec 2015 14:47:44 GMT

Content-Type: application/json

Content-Length: 25

Connection: close

X-Powered-By: PHP/5.5.29

Set-Cookie: PHPSESSID=olhduanaf84n192tmnbg6iea94; path=/

Pragma: no-cache

Expires: 0

Cache-Control: must-revalidate

{"number_01":"3 80123456789"}

http type:

HTTP/1.1 200 OK

Server: nginx/1.6.3

Date: Wed, 09 Dec 2015 14:34:46 GMT

Content-Type: text/html; charset=UTF-8

Content-Length: 9

Connection: close

X-Powered-By: PHP/5.5.29

Set-Cookie: PHPSESSID=b3f9mfs1eg3bkflrbprqk4qmd5; path=/

Expires: Thu, 19 Nov 1981 08:52:00 GMT

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0

Pragma: no-cache

380123456789

In case you need any assistance feel free to contactour Support team via chat or through the email support@ringostat.com.

Is article helpful?