How to manually hang up a call

Hello everyone,

I’m trying to figure out how to manually hang up a call. I’ve gone through the docs but couldn’t find a clear way to do it.

Has anyone done this before or knows how it can be handled?

Thanks!

Hello Atilio,

May i request you to elaborate more on your request ?

Sure! I’m looking for a way to make the bot hang up the call — either using a script or some method to force the hang-up from a specific dialog.

Let me know if there’s a recommended approach for this.

Thanks!

Hey @atilio_luque,

Please use the hangup voice utils function which is used to forcefully hangup the call from Bot In mid of Flow/Call

This will play the Message and then Hangup the Call with passing the headers.

This will also used to send Dynamically SIP headers In bye (Similar to SIP Bye).

All message and headers , queueCommand are optional Parameters.

Options Description Type Required
Message Message to play before Hangup String No
Headers An object containing SIP headers to include in the BYE request Object No
queueCommand If true, queue this command until previous commands are completed; otherwise, interrupt and flush all previous commands and execute this command immediately Boolean No (By default-True)
1) With message and headers
var message = "Call completed";
var headers = {
	"X-Reason" : "Call hangup from Kore side"
}

print(voiceUtils.hangup(message,headers));

                                or

2) Without Message but containg headers
  var message = "";
  var headers = { "X-Reason" : "completed"}
print(voiceUtils.hangup(message,headers));

You need to configure this script in a message node with SmartAssist Voice Gateway Channel in Javascript mode.

Hope this helps. Please do let us me know if you have any further queries.

1 Like