类 NettyInboundClient

java.lang.Object
link.thingscloud.freeswitch.esl.inbound.NettyInboundClient
所有已实现的接口:
ChannelEventListener, InboundClient, InboundClientService

public class NettyInboundClient extends Object

NettyInboundClient class.

版本:
1.0.0
作者:
: zhouhailin
  • 构造器详细资料

  • 方法详细资料

    • sendSyncApiCommand

      public 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

      public 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

      public 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

      public 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

      public 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

      public 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

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

      public 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

      public CommandResponse deleteEventFilter(String addr, String eventHeader, String valueToFilter)
      Delete an event filter from the current set of event filters on this connection. See InboundClient.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

      public 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

      public 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

      public 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

      public 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

      public 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

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

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

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

      public InboundClientOption option()
      获取客户可配置选项
      指定者:
      option 在接口中 InboundClient
      返回:
      this
    • start

      public void start()

      start.

      指定者:
      start 在接口中 InboundClientService
    • shutdown

      public void shutdown()

      shutdown.

      指定者:
      shutdown 在接口中 InboundClientService
    • onChannelActive

      public void onChannelActive(String remoteAddr, InboundChannelHandler inboundChannelHandler)

      onChannelActive.

      指定者:
      onChannelActive 在接口中 ChannelEventListener
      参数:
      remoteAddr - a String object.
      inboundChannelHandler - a InboundChannelHandler object.
    • onChannelClosed

      public void onChannelClosed(String remoteAddr)

      onChannelClosed.

      指定者:
      onChannelClosed 在接口中 ChannelEventListener
      参数:
      remoteAddr - a String object.
    • handleAuthRequest

      public void handleAuthRequest(String addr, InboundChannelHandler inboundChannelHandler)

      handleAuthRequest.

      指定者:
      handleAuthRequest 在接口中 ChannelEventListener
      参数:
      addr - a String object.
      inboundChannelHandler - a InboundChannelHandler object.
    • handleEslEvent

      public void handleEslEvent(String addr, EslEvent event)

      handleEslEvent.

      指定者:
      handleEslEvent 在接口中 ChannelEventListener
      参数:
      addr - a String object.
      event - a EslEvent object.
    • handleDisconnectNotice

      public void handleDisconnectNotice(String addr)

      handleDisconnectNotice.

      指定者:
      handleDisconnectNotice 在接口中 ChannelEventListener
      参数:
      addr - a String object.
    • handleRudeRejection

      public void handleRudeRejection(String addr)

      handleRudeRejection.

      指定者:
      handleRudeRejection 在接口中 ChannelEventListener
      参数:
      addr - a String object.
    • getAuthedHandler

      public InboundChannelHandler getAuthedHandler(String addr)

      getAuthedHandler.

      参数:
      addr - a String object.
      返回:
      a InboundChannelHandler object.