接口 InboundClient

所有超级接口:
InboundClientService
所有已知实现类:
NettyInboundClient

public interface InboundClient extends InboundClientService

InboundClient interface.

版本:
1.0.0
作者:
: zhouhailin
  • 方法详细资料

    • newInstance

      static InboundClient newInstance(InboundClientOption option)

      newInstance.

      参数:
      option - a InboundClientOption object.
      返回:
      a InboundClient object.
    • newBootstrap

      static InboundClientBootstrap newBootstrap(InboundClientOption option)

      newBootstrap.

      参数:
      option - a InboundClientOption object.
      返回:
      a InboundClientBootstrap object.
    • getInstance

      static InboundClient getInstance()

      getInstance.

      返回:
      a InboundClient object.
    • getBootstrap

      static InboundClientBootstrap getBootstrap()

      getBootstrap.

      返回:
      a InboundClientBootstrap object.
    • option

      获取客户可配置选项
      返回:
      this
    • sendSyncApiCommand

      EslMessage sendSyncApiCommand(String addr, String command, String arg)
      Sends a FreeSWITCH API command to the server and blocks, waiting for an immediate response from the server.

      The outcome of the command from the server is retured in an EslMessage object.

      参数:
      addr - Esl server address
      command - API command to send
      arg - command arguments
      返回:
      an EslMessage containing command results
    • sendSyncApiCommand

      EslMessage sendSyncApiCommand(String addr, String command, String arg, long timeoutSeconds) throws InboundTimeoutExcetion
      Sends a FreeSWITCH API command to the server and blocks, waiting for an immediate response from the server.

      The outcome of the command from the server is retured in an EslMessage object.

      参数:
      addr - Esl server address
      command - API command to send
      arg - command arguments
      timeoutSeconds - timeout seconds arguments
      返回:
      an EslMessage containing command results
      抛出:
      InboundTimeoutExcetion - if any.
    • sendSyncApiCommand

      void sendSyncApiCommand(String addr, String command, String arg, Consumer<EslMessage> consumer)
      Aync callback Sends a FreeSWITCH API command to the server and blocks, waiting for an immediate response from the server.

      The outcome of the command from the server is retured in an EslMessage object.

      参数:
      addr - Esl server address
      command - API command to send
      arg - command arguments
      consumer - a Consumer object.
    • sendAsyncApiCommand

      String sendAsyncApiCommand(String addr, String command, String arg)
      Submit a FreeSWITCH API command to the server to be executed in background mode. A synchronous response from the server provides a UUID to identify the job execution results. When the server has completed the job execution it fires a BACKGROUND_JOB Event with the execution results.

      Note that this Client must be subscribed in the normal way to BACKGOUND_JOB Events, in order to receive this event.

      参数:
      addr - Esl server address
      command - API command to send
      arg - command arguments
      返回:
      String Job-UUID that the server will tag result event with.
    • sendAsyncApiCommand

      void sendAsyncApiCommand(String addr, String command, String arg, Consumer<String> consumer)
      Aync callback Submit a FreeSWITCH API command to the server to be executed in background mode. A synchronous response from the server provides a UUID to identify the job execution results. When the server has completed the job execution it fires a BACKGROUND_JOB Event with the execution results.

      Note that this Client must be subscribed in the normal way to BACKGOUND_JOB Events, in order to receive this event.

      参数:
      addr - Esl server address
      command - API command to send
      arg - command arguments
      consumer - a Consumer object.
    • setEventSubscriptions

      CommandResponse setEventSubscriptions(String addr, String format, String events)
      Set the current event subscription for this connection to the server. Examples of the events argument are:
         ALL
         CHANNEL_CREATE CHANNEL_DESTROY HEARTBEAT
         CUSTOM conference::maintenance
         CHANNEL_CREATE CHANNEL_DESTROY CUSTOM conference::maintenance sofia::register sofia::expire
       

      Subsequent calls to this method replaces any previous subscriptions that were set.

      Note: current implementation can only process 'plain' events.
      参数:
      addr - Esl server address
      format - can be { plain | xml }
      events - { all | space separated list of events }
      返回:
      a CommandResponse with the server's response.
    • cancelEventSubscriptions

      CommandResponse cancelEventSubscriptions(String addr)
      Cancel any existing event subscription.
      参数:
      addr - Esl server address
      返回:
      a CommandResponse with the server's response.
    • addEventFilter

      CommandResponse addEventFilter(String addr, String eventHeader, String valueToFilter)

      Add an event filter to the current set of event filters on this connection. Any of the event headers can be used as a filter.

      Note that event filters follow 'filter-in' semantics. That is, when a filter is applied only the filtered values will be received. Multiple filters can be added to the current connection.

      Example filters:
          eventHeader        valueToFilter
          ----------------------------------
          Event-Name         CHANNEL_EXECUTE
          Channel-State      CS_NEW
       
      参数:
      addr - Esl server address
      eventHeader - to filter on
      valueToFilter - the value to match
      返回:
      a CommandResponse with the server's response.
    • deleteEventFilter

      CommandResponse deleteEventFilter(String addr, String eventHeader, String valueToFilter)
      Delete an event filter from the current set of event filters on this connection. See addEventFilter(java.lang.String, java.lang.String, java.lang.String)
      参数:
      addr - Esl server address
      eventHeader - to remove
      valueToFilter - to remove
      返回:
      a CommandResponse with the server's response.
    • sendEvent

      CommandResponse sendEvent(String addr, SendEvent sendEvent)
      Send a SendMsg command to FreeSWITCH. This client requires that the SendMsg has a call UUID parameter.

      https://freeswitch.org/confluence/display/FREESWITCH/mod_event_socket

      参数:
      addr - Esl server address
      sendEvent - a SendEvent Event
      返回:
      a CommandResponse with the server's response.
    • sendEvent

      void sendEvent(String addr, SendEvent sendEvent, Consumer<CommandResponse> consumer)
      Aync callback Send a SendMsg command to FreeSWITCH. This client requires that the SendMsg has a call UUID parameter.

      https://freeswitch.org/confluence/display/FREESWITCH/mod_event_socket

      参数:
      addr - Esl server address
      sendEvent - a SendEvent Event
      consumer - a Consumer object.
    • sendMessage

      CommandResponse sendMessage(String addr, SendMsg sendMsg)
      Send a SendMsg command to FreeSWITCH. This client requires that the SendMsg has a call UUID parameter.

      https://freeswitch.org/confluence/display/FREESWITCH/mod_event_socket

      参数:
      addr - Esl server address
      sendMsg - a SendMsg with call UUID
      返回:
      a CommandResponse with the server's response.
    • sendMessage

      void sendMessage(String addr, SendMsg sendMsg, Consumer<CommandResponse> consumer)
      Aync callback Send a SendMsg command to FreeSWITCH. This client requires that the SendMsg has a call UUID parameter.

      https://freeswitch.org/confluence/display/FREESWITCH/mod_event_socket

      参数:
      addr - Esl server address
      sendMsg - a SendMsg with call UUID
      consumer - a Consumer object.
    • setLoggingLevel

      CommandResponse setLoggingLevel(String addr, String level)
      Enable log output.
      参数:
      addr - Esl server address
      level - using the same values as in console.conf
      返回:
      a CommandResponse with the server's response.
    • cancelLogging

      CommandResponse cancelLogging(String addr)
      Disable any logging previously enabled with setLogLevel().
      参数:
      addr - Esl server address
      返回:
      a CommandResponse with the server's response.
    • close

      CommandResponse close(String addr)
      Close the socket connection
      参数:
      addr - Esl server address
      返回:
      a CommandResponse with the server's response.
    • closeChannel

      InboundClient closeChannel(String addr)
      Close the socket connection
      参数:
      addr - Esl server address
      返回:
      a CommandResponse with the server's response.