Hangup command

The Hangup command is used to disconnect a call. If the OzML code of the call reaches its end, it hangs up automatically.

Command example usage:

It is best used if you want to hang the call up after a given menu point. For example: 'Congratulation! You subscribed to the golden package. Goodbye!' and then it hangs up. It also can be used by phone companies to hang up calls if the client has no more money in his phone account.

Parameters:

Note: CallId is only considered in case of third party call control.

Parameter name Value Description Mandatory
CallId string value,
e.g. 23Xdz7
The call ID of the call you want to hangup. By default it is known from the CallChanged notification. No

Extension control examples

Simple example:

One second passes then the speak engine says: 'Your call will be hanged up in 5 seconds.' After this 5 second passes and the phone is hanged up.

<?xml version="1.0"?>
<Response>
  <Delay>1</Delay>
  <Speak>Your call will be hanged up in 5 seconds.</Speak>
  <Delay>5</Delay>
  <Hangup></Hangup>
</Response>

This does the same as the previous example because if the OzML code reaches it's end it hangs up the call:

<?xml version="1.0"?>
<Response>
  <Delay>1</Delay>
  <Speak>Your call will be hanged up in 5 seconds.</Speak>
  <Delay>5</Delay>
</Response>

Detailed example:

If you don't understand the following example I advise you to read about the Userinput command.

This speaks the 2 sentences between the <InitialCommands></InitialCommands> nodes repeatedly with a 2 second delay and scans the pressed numbers at the same time.
By pressing 1 it will say: "Congratulation! You subscribed to the silver package. Goodbye!" and hangs up.
By pressing 2 it will say: "Congratulation! You subscribed to the golden package. Goodbye!" and hangs up.

<?xml version="1.0"?>
<Response>
  <UserInput timeout="2" repeat="true">
    <InitialCommands>
      <Speak>To subscribe to the silver package, press 1.</Speak>
      <Speak>To subscribe to the golden package, press 2.</Speak>
    </InitialCommands>
    <Inputs>
      <Input key="1">
        <Speak>Congratulation! You subscribed to the silver package. Goodbye!</Speak>
        <Hangup></Hangup>
      </Input>
      <Input key="2">
        <Speak>Congratulation! You subscribed to the golden package. Goodbye!</Speak>
        <Hangup></Hangup>
      </Input>
    </Inputs>
  </UserInput>
</Response>

Hangup command is used in OzML responses to this notification:
GoTo, RecordCompleted, DtmfEntered, SMSDeliveryReport, IncomingSMS, IncomingCall, CallConnected

Third party call control examples

Simple example:

Hangs up the call.

<?xml version="1.0"?>
<Response>
  <Hangup></Hangup>
</Response>

Detailed example:

At first the speak engine says to all participants of the call: 'Call ID 23Xdz7 and your call will be hanged up.' Then it says to all participants of call ID 23Xdz7: 'This call will be hanged up.' Then call ID 23Xdz7 and the actual call (the call ID which was in the CallChanged notification) is hanged up.

<?xml version="1.0"?>
<Response>
  <Speak Party="all">Call ID 23Xdz7 and your call will be hanged up.</Speak>
  <Speak Party="all" CallId=23Xdz7>This call will be hanged up.</Speak>
  <Hangup CallId="23Xdz7"></Hangup>
  <Hangup></Hangup>
</Response>

Hangup command is used in OzML responses to this notification:
CallChanged, RecordCompleted

More information