Webhooks for Apps

This document covers events produced by Apps on OnSIP's platform (for a full introduction to call events, refer here).

Attendant Menu

Events

A "started" event is generated when the menu begins playing its recording. After the recording is played, the user can begin to enter a combination of dialtones. If the dialtone combination matches a preset option or maps to an extension (and the menu has activated extensions), then the user is transferred, generating a "transferred" event on successful completion.

If the user enters a combination of dialtones that do not map to a valid entry, an "invalid DTMF" event is generated. If the user hangs up, an "abandoned" event is generated.

Note that for all attendant menu events, the "from URI" will map to a DID, and the "to URI" will be the menu's sip address. Both the "transferred" and "invalid DTMF" events contain an "entry" field which contains the entered dialtones.

Packet Details

The de facto reference for the event packet/payload format will always be available via the Webhook Schema github page. We provide up-to-date JSON Schemas for each packet type, and these schemas are made available to be used by client applications wishing to validate the data that we send. Every event contains the same top-level fields, but the fields contained in the payload object are dependent upon type. We make the payload fields for some types available below for convenience, but as stated above the Webhook Schema github page is the best reference.

Some types have the same payload formats, and they are grouped together below.

app.attendant-menu.started
app.attendant-menu.abandoned

Key Value
callId Uniquely identifies the call.
fromUri URI of the caller.
toUri URI of the Attendant Menu.

Example:

{
  "id": "189004747f808d1fd2c4b848480fa270",
  "streamId": "1cd4606b-4c84-45b2-80f8-9318e7aea112",
  "subscriptionId": "abd490jvja0490af",
  "type": "app.attendant-menu.started",
  "payload": {
      "callId": "8b41c365-11d8-1236-619d-5254002c49e7",
      "toUri": "sip:menu@foo.onsip.com",
      "fromUri": "sip:11238036862@jnctn.net"
  },
  "createdAt": "2018-01-11T21:10:58.735641Z"
}

app.attendant-menu.transferred

Key Value
callId Uniquely identifies the call.
entry String containing the DTMF tones entered by the user.
fromUri URI of the caller.
toUri URI of the Attendant Menu.
referTo URI of the transfer address.

Example:

{
  "id": "189004747f808d1fd2c4b848480fa270",
  "streamId": "1cd4606b-4c84-45b2-80f8-9318e7aea112",
  "subscriptionId": "abd490jvja0490af",
  "type": "app.attendant-menu.transferred",
  "payload": {
      "callId": "8b41c365-11d8-1236-619d-5254002c49e7",
      "entry": "7001",
      "toUri": "sip:menu@foo.onsip.com",
      "fromUri": "sip:11238036862@jnctn.net",
      "referTo": "sip:alice@foo.onsip.com"
  },
  "createdAt": "2018-01-11T21:10:58.735641Z"
}

app.attendant-menu.invalid-dtmf

Key Value
callId Uniquely identifies the call.
entry String containing the DTMF tones entered by the user.
fromUri URI of the caller.
toUri URI of the Attendant Menu.

Example:

{
  "id": "189004747f808d1fd2c4b848480fa270",
  "streamId": "1cd4606b-4c84-45b2-80f8-9318e7aea112",
  "subscriptionId": "abd490jvja0490af",
  "type": "app.attendant-menu.started",
  "payload": {
      "callId": "8b41c365-11d8-1236-619d-5254002c49e7",
      "entry": "7001",
      "toUri": "sip:menu@foo.onsip.com",
      "fromUri": "sip:11238036862@jnctn.net"
  },
  "createdAt": "2018-01-11T21:10:58.735641Z"
}