类 NettyInboundClient
- 所有已实现的接口:
ChannelEventListener,InboundClient,InboundClientService
NettyInboundClient class.
- 版本:
- 1.0.0
- 作者:
- : zhouhailin
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明addEventFilter(String addr, String eventHeader, String valueToFilter) Add an event filter to the current set of event filters on this connection.Cancel any existing event subscription.cancelLogging(String addr) Disable any logging previously enabled with setLogLevel().Close the socket connectioncloseChannel(String addr) Close the socket connectiondeleteEventFilter(String addr, String eventHeader, String valueToFilter) Delete an event filter from the current set of event filters on this connection.getAuthedHandler(String addr) getAuthedHandler.voidhandleAuthRequest(String addr, InboundChannelHandler inboundChannelHandler) handleAuthRequest.voidhandleDisconnectNotice(String addr) handleDisconnectNotice.voidhandleEslEvent(String addr, EslEvent event) handleEslEvent.voidhandleRudeRejection(String addr) handleRudeRejection.voidonChannelActive(String remoteAddr, InboundChannelHandler inboundChannelHandler) onChannelActive.voidonChannelClosed(String remoteAddr) onChannelClosed.option()获取客户可配置选项sendAsyncApiCommand(String addr, String command, String arg) Submit a FreeSWITCH API command to the server to be executed in background mode.voidAync callback Submit a FreeSWITCH API command to the server to be executed in background mode.Send aSendMsgcommand to FreeSWITCH.voidsendEvent(String addr, SendEvent sendEvent, Consumer<CommandResponse> consumer) Aync callback Send aSendMsgcommand to FreeSWITCH.sendMessage(String addr, SendMsg sendMsg) Send aSendMsgcommand to FreeSWITCH.voidsendMessage(String addr, SendMsg sendMsg, Consumer<CommandResponse> consumer) Aync callback Send aSendMsgcommand to FreeSWITCH.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.sendSyncApiCommand(String addr, String command, String arg, long timeoutSeconds) Sends a FreeSWITCH API command to the server and blocks, waiting for an immediate response from the server.voidsendSyncApiCommand(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.setEventSubscriptions(String addr, String format, String events) Set the current event subscription for this connection to the server.setLoggingLevel(String addr, String level) Enable log output.voidshutdown()shutdown.voidstart()start.
-
构造器详细资料
-
NettyInboundClient
Constructor for NettyInboundClient.
- 参数:
option- aInboundClientOptionobject.
-
-
方法详细资料
-
sendSyncApiCommand
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
EslMessageobject.- 参数:
addr- Esl server addresscommand- API command to sendarg- command arguments- 返回:
- an
EslMessagecontaining 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
EslMessageobject.- 参数:
addr- Esl server addresscommand- API command to sendarg- command argumentstimeoutSeconds- timeout seconds arguments- 返回:
- an
EslMessagecontaining 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
EslMessageobject.- 参数:
addr- Esl server addresscommand- API command to sendarg- command argumentsconsumer- aConsumerobject.
-
sendAsyncApiCommand
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 addresscommand- API command to sendarg- command arguments- 返回:
- String Job-UUID that the server will tag result event with.
-
sendAsyncApiCommand
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 addresscommand- API command to sendarg- command argumentsconsumer- aConsumerobject.
-
setEventSubscriptions
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 addressformat- can be { plain | xml }events- { all | space separated list of events }- 返回:
- a
CommandResponsewith the server's response.
-
cancelEventSubscriptions
Cancel any existing event subscription.- 参数:
addr- Esl server address- 返回:
- a
CommandResponsewith the server's response.
-
addEventFilter
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 addresseventHeader- to filter onvalueToFilter- the value to match- 返回:
- a
CommandResponsewith the server's response.
-
deleteEventFilter
Delete an event filter from the current set of event filters on this connection. SeeInboundClient.addEventFilter(java.lang.String, java.lang.String, java.lang.String)- 参数:
addr- Esl server addresseventHeader- to removevalueToFilter- to remove- 返回:
- a
CommandResponsewith the server's response.
-
sendEvent
Send aSendMsgcommand to FreeSWITCH. This client requires that theSendMsghas a call UUID parameter.https://freeswitch.org/confluence/display/FREESWITCH/mod_event_socket
- 参数:
addr- Esl server addresssendEvent- aSendEventEvent- 返回:
- a
CommandResponsewith the server's response.
-
sendEvent
-
sendMessage
Send aSendMsgcommand to FreeSWITCH. This client requires that theSendMsghas a call UUID parameter.https://freeswitch.org/confluence/display/FREESWITCH/mod_event_socket
- 参数:
addr- Esl server addresssendMsg- aSendMsgwith call UUID- 返回:
- a
CommandResponsewith the server's response.
-
sendMessage
-
setLoggingLevel
Enable log output.- 参数:
addr- Esl server addresslevel- using the same values as in console.conf- 返回:
- a
CommandResponsewith the server's response.
-
cancelLogging
Disable any logging previously enabled with setLogLevel().- 参数:
addr- Esl server address- 返回:
- a
CommandResponsewith the server's response.
-
close
Close the socket connection- 参数:
addr- Esl server address- 返回:
- a
CommandResponsewith the server's response.
-
closeChannel
Close the socket connection- 参数:
addr- Esl server address- 返回:
- a
CommandResponsewith the server's response.
-
option
获取客户可配置选项- 指定者:
option在接口中InboundClient- 返回:
- this
-
start
public void start()start.
- 指定者:
start在接口中InboundClientService
-
shutdown
public void shutdown()shutdown.
- 指定者:
shutdown在接口中InboundClientService
-
onChannelActive
onChannelActive.
- 指定者:
onChannelActive在接口中ChannelEventListener- 参数:
remoteAddr- aStringobject.inboundChannelHandler- aInboundChannelHandlerobject.
-
onChannelClosed
onChannelClosed.
- 指定者:
onChannelClosed在接口中ChannelEventListener- 参数:
remoteAddr- aStringobject.
-
handleAuthRequest
handleAuthRequest.
- 指定者:
handleAuthRequest在接口中ChannelEventListener- 参数:
addr- aStringobject.inboundChannelHandler- aInboundChannelHandlerobject.
-
handleEslEvent
handleEslEvent.
- 指定者:
handleEslEvent在接口中ChannelEventListener- 参数:
addr- aStringobject.event- aEslEventobject.
-
handleDisconnectNotice
handleDisconnectNotice.
- 指定者:
handleDisconnectNotice在接口中ChannelEventListener- 参数:
addr- aStringobject.
-
handleRudeRejection
handleRudeRejection.
- 指定者:
handleRudeRejection在接口中ChannelEventListener- 参数:
addr- aStringobject.
-
getAuthedHandler
getAuthedHandler.
- 参数:
addr- aStringobject.- 返回:
- a
InboundChannelHandlerobject.
-