When a call is ended on your end, such as the recipient hungs up or the user ends the call from your UI, we'll need to be notified to close the phone widget in Upsales.
Just in case, we'll poll the /ongoing endpoint with a few seconds delay, but for instant feedback to the user this is an important part.
In order to tell Upsales that you want to control the hangup flow, add the capability hangupHook to your config json.
"capabilities": {
"hangupHook": true
}
Initiate a manual run of your app to notify Upsales that a phone call has been hung up by the recipient. Add a notification property to the body to trigger the correct event.
{
"notification": {
"event": "phone.hangup",
"data": {}
}
}