Event Callbacks
Event Callbacks are used to notify your application whenever particular events occur on the Ubity telephony/UC platform. Ultimately, these events can range from a user making or receiving a call,
At the moment, these are the events that your application can subscribe to:
CallInitiatedeventCallAnsweredeventCallEndedevent
To setup the callbacks, you will need to ask Ubity Support specifying the URL you want to be request for each event. You may have to prove that you own those URL.
CALLBACK URLS
In order for your application to be notified of a particular event, one or more callback URLs need to be associated to that event.
HTTP REQUEST
Both GET and POST requests are supported.
CallInitiated Event
This event notifies your application whenever a user or extension in your company makes or receives a call. This event indicates that the other end is ringing, and not that it has answered (see CallAnswered event).
HTTP REQUEST
Both GET and POST requests are supported.
QUERY PARAMETERS
| Parameter | Description |
|---|---|
| callid | A unique identifier string for the call |
| type | The type of the call, or its direction (incoming, outgoing) |
| caller | The extension or phone number that initiated the call |
| callee | The extension or phone number that received the call |
EXAMPLES
- An
outgoingcall initiated by extension100to phone number5145551212will trigger the following event:
GET https://yourapp.com/init?callid=ABC12345&type=outgoing&caller=100&callee=5145551212
- An
incomingcall received by extension100from phone number5145551212will trigger the following event:
POST https://yourapp.com/init?callid=ABC12345&type=incoming&caller=5145551212&callee=100
CallAnswered Event
This event notifies your application when a previously initiated call (see CallInitiated event) has been answered by its recipient.
HTTP REQUEST
Both GET and POST requests are supported.
QUERY PARAMETERS
| Parameter | Description |
|---|---|
| callid | A unique identifier string for the call (same as CallInitiated) |
| type | The type of the call, or its direction (incoming, outgoing) |
| caller | The extension or phone number that initiated the call |
| callee | The extension or phone number that received the call |
EXAMPLES
- An
outgoingcall initiated by extension100to phone number5145551212has now been answered by5145551212:
GET https://yourapp.com/answered?callid=ABC12345&type=outgoing&caller=100&callee=5145551212
- An
incomingcall received by extension100from phone number5145551212has now been answered by extension100:
POST https://yourapp.com/answered?callid=ABC12345&type=incoming&caller=5145551212&callee=100
CallEnded Event
This event notifies your application when a previously initiated, then answered call is hung up.
HTTP REQUEST
Both GET and POST requests are supported.
QUERY PARAMETERS
| Parameter | Description |
|---|---|
| callid | A unique identifier string for the call (same as CallInitiated and CallAnswered) |
| type | The type of the call, or its direction (incoming, outgoing) |
| caller | The extension or phone number that initiated the call |
| callee | The extension or phone number that received the call |
| duration | The duration of the call (in seconds) |
EXAMPLES
- An
outgoingcall between extension100and5145551212ends after300 seconds(5 minutes):
GET https://yourapp.com/ended?callid=ABC12345&type=outgoing&caller=100&callee=5145551212&duration=300
- An
incomingcall for extension100from5145551212ends after300 seconds(5 minutes):
POST https://yourapp.com/ended?callid=ABC12345&type=incoming&caller=5145551212&callee=100&duration=300
-
The type or direction of a call is always taken from the user's perspective. ↩