Rate this page:

How to handle incoming calls

Voximplant can accept calls from different sources: phones, web pages, mobile devices. You can rent a number from us or connect your current phone number via SIP. After that, you'll be able to accept incoming calls to the rented number.

Handling a call

In the Voximplant control panel, select My phone numbers from the menu on the left and then select Buy new phone number in the upper right corner and buy one (a real or a test one).

Associate a phone number with the application created to execute your JavaScript code. To do so, go to Applications, click on the needed application and switch to the Numbers tab. Here, click on the Available tab, select a number and click Attach.

A confirmation dialog will appear; you can leave all by default and click the Attach button.

Then you have to create a scenario with the subscription to the CallAlerting event so that the handler function will be called in the cloud right after an incoming call arrives.

Usage sample

Usage sample

When the connection is established, you will hear a synthesized voice that reads the text.

Now you can call a purchased phone number using one of the access numbers displayed on the page, followed by an extension. And the Voximplant cloud will execute your JavaScript code and carry out your instructions.


To handle an incoming call using SDKs, use answer / answerWithSettings method since voice can be sent only to an answered call. The reject / rejectWithMode method rejects an incoming call on the part of an SDK. If a call is initiated from the PSTN, the network will receive the "reject" command; in case of a call from another SDK client, it will receive the Failed / didFailWithError / onCallFailed event.

SDK samples

SDK samples