This site is no longer updated.Go to new Conversational Cloud docs

$dialer.getBargeInIntentStatus


This method allows obtaining the data on conditional barge-in from the script.

The method should only be called from the conditional barge-in event (bargeInIntent) handler.

Syntax

The method is called without arguments and returns and object with two string properties:

  • bargeInIf – conditional barge-in label.
  • text – the text of the barge-in attempt request.
$dialer.getBargeInIntentStatus(); // => Example: {bargeInIf: "OfferNotDone", text: "hold on"}

How to use

Based on the information on the barge-in label and text, the bargeInIntent event handler determines whether the bot should interrupt. If the barge-in condition is satisfied, the handler should call $dialer.bargeInInterrupt and pass true as its argument.

state: BargeInIntent
    event: bargeInIntent
    script:
        var text = $dialer.getBargeInIntentStatus().text;

        if (text.indexOf("human") > -1) {
            $dialer.bargeInInterrupt(true);
        }