java.lang.Object
com.bytedesk.call.esl.client.transport.SendMsg

public class SendMsg extends Object
  • Field Details

    • msgLines

      private final List<String> msgLines
    • hasUuid

      private final boolean hasUuid
  • Constructor Details

    • SendMsg

      public SendMsg()
      Constructor for use with outbound socket client only. This client mode does not need a call UUID for context.
    • SendMsg

      public SendMsg(String uuid)
      Constructor for use with the inbound client.
      Parameters:
      uuid - of the call to send message to (it should be in 'park' to be operated on).
  • Method Details

    • addCallCommand

      public SendMsg addCallCommand(String command)
      Adds the following line to the message:
         call-command: command
       
      Parameters:
      command - the string command [ execute | hangup ]
    • addExecuteAppName

      public SendMsg addExecuteAppName(String appName)
      Adds the following line to the message:
         execute-app-name: appName
       
      Parameters:
      appName - the string app name to execute
    • addExecuteAppArg

      public SendMsg addExecuteAppArg(String arg)
      Adds the following line to the message:
         execute-app-arg: arg
       
      Parameters:
      arg - the string arg
    • addLoops

      public SendMsg addLoops(int count)
      Adds the following line to the message:
         loops: count
       
      Parameters:
      count - the int number of times to loop
    • addHangupCause

      public SendMsg addHangupCause(String cause)
      Adds the following line to the message:
         hangup-cause: cause
       
      Parameters:
      cause - the string cause
    • addNomediaUuid

      public SendMsg addNomediaUuid(String value)
      Adds the following line to the message:
         nomedia-uid: value
       
      Parameters:
      value - the string value part of the line
    • addEventLock

      public SendMsg addEventLock()
      Adds the following line to the message:
          event-lock: true
        
    • addGenericLine

      public SendMsg addGenericLine(String name, String value)
      A generic method to add a message line. The constructed line in the sent message will be in the form:
         name: value
       
      Parameters:
      name - part of line
      value - part of line
    • getMsgLines

      public List<String> getMsgLines()
      The list of strings that make up the message to send to FreeSWITCH.
      Returns:
      list of strings, as they were added to this message.
    • hasUuid

      public boolean hasUuid()
      Indicate if message was constructed with a UUID.
      Returns:
      true if constructed with a UUID.
    • toString

      public String toString()
      Overrides:
      toString in class Object