Call Handle

This method allows you to set up your handleURL and to forward all incoming calls to your Virtual Number to this URL.

Your handleURL can be configured at the sub account level through the Number Masking webhooks.

Request

When receiving an incoming call to your virtual number Wavecell platform will POST a JSON object to your URL.

The JSON object will contain the following values:

Namee

Type

Description

sessionId

String

Unique id that represents call masking session [UUID]

callId

String

Id unique to a one call leg of the number masking session [UUID]

eventType

String

Event type represents the life cycle status of the call. CALL_RECEIVED or DTMF_RECEIVED

sourceMsisdn

String

Number of the calling party in E.164 format. This should be the Virtual Number allocated to your sub-account

targetMsisdn

String

Number of the called party in E.164 format (The second user's number).

direction

Integer

0 for Inbound call, 1 for Outbound call

referenceId

String

The referenceId that you want set up for the number masking session.

timestamp

Timestamp

Timestamp of a call event

status

String

Status for the call. Possible values:

  • CONNECTED
  • NOT_CONNECTED

duration

Integer

Call duration in seconds

dtmf

Integer

Calling user's dial-pad inputs in the number masking session.

sipStatus

Integer

Final Sip status code for the call leg(s) defined by RFC 3261

Example of a JSON object sent to your handleURL:

{
  "callId": "a1d6a5e3-efec-11e9-b999-7d370b5f90d1", 
  "sessionId": "a1d6a5e2-efec-11e9-b999-efc71013a78f", 
  "eventType": "CALL_RECEIVED",
  "direction": 0,
  "timestamp": "2019-10-16T08:12:01Z", 
  "sourceMsisdn": "6512345678", 
  "targetMsisdn": "6587654321", 
  "status": "NOT_CONNECTED", 
  "duration": 0,
  "dtmf": 787
}

To start your call flow you need to reply to the call handle with an HTTP 200 response code including a Call Action in the HTTP response body. The supported Call Actions are:

  • PlayTTS - Generates and plays a TTS to the calling user.
  • PlayFile - Plays a pre-recorded message to the calling user.
  • MakeCall - Initiates an outgoing call to the desired destination. Once answered, the calling user and the second user (outgoing call destination) will be connected to the same call flow.
  • Hangup - Terminates the ongoing call.