java.lang.Object
dev.truewinter.twiliocallrouter.plugin.Event
Direct Known Subclasses:
ForwardCallEvent, InboundCallEvent, OutboundCallEvent, TransferCallEvent

public abstract class Event extends Object
  • Constructor Details

    • Event

      public Event()
  • Method Details

    • setCancelled

      public void setCancelled(boolean cancelled)
      This method allows plugin developers to reject the call
      Parameters:
      cancelled - whether this call should be rejected
    • isCancelled

      public boolean isCancelled()
      Returns:
      true if the call has been cancelled
    • setCustomTwiML

      public void setCustomTwiML(@NotNull com.twilio.twiml.VoiceResponse customTwiML)
      Using this method allows plugin developers to control how this call (or part of call) will be handled
      Parameters:
      customTwiML - The TwiML to provide to Twilio, in a VoiceResponse object
    • setCustomTwiML

      public void setCustomTwiML(@NotNull String customTwiML) throws com.twilio.twiml.TwiMLException
      Using this method allows plugin developers to control how this call (or part of call) will be handled. This is a convenience method provided to developers who wish to use a different TwiML library.
      Parameters:
      customTwiML - The TwiML to provide to Twilio
      Throws:
      com.twilio.twiml.TwiMLException - if the TwiML is invalid
      See Also:
    • getCustomTwiML

      @NotNull public Optional<com.twilio.twiml.VoiceResponse> getCustomTwiML()
      Returns:
      The custom TwiML set, wrapped in an Optional
    • getCustomTwiMLAsString

      @NotNull public Optional<String> getCustomTwiMLAsString()
      Returns:
      The custom TwiML set, wrapped in an Optional
      See Also: