我正在构建一个使用SIP over websockets并作为b2bua工作的java应用程序,即该应用程序在另一个SIP服务器上注册了许多sip用户。
我想知道是否有办法以某种方式重用现有的收听点?似乎对于每个SIP客户端,我应该创建SipStack
,SipListeningPoint
,SipProvider
,然后调用SipProvider
的{{1}}来实际发送SIP消息目标服务器。但是sendRequest
的创建会分配一个新的套接字来接受传入的连接(我真的不需要),所以我需要为我在远程服务器上注册的每个SIP客户端打开一个套接字。
我尝试重用SipListeningPoint
,但有一个限制,即每SipListeningPoint
只允许一个收听点。我还尝试重用SipStack
,但它导致了SipProvider
中的例外。
SSLStateMachine
(是的,我知道这个堆栈跟踪通常意味着SSL证书存在一些问题。但是当我为每个sip用户创建单独的监听点或者我只注册一个sip用户时,SSL连接成功建立)
以下是我设置的javax.net.ssl.SSLException: Received fatal alert: handshake_failure
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1666)
at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1634)
at sun.security.ssl.SSLEngineImpl.recvAlert(SSLEngineImpl.java:1800)
at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:1083)
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:907)
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:781)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
at gov.nist.javax.sip.stack.SSLStateMachine.unwrap(SSLStateMachine.java:303)
at gov.nist.javax.sip.stack.SSLStateMachine.unwrap(SSLStateMachine.java:244)
at gov.nist.javax.sip.stack.NioTlsWebSocketMessageChannel.addBytes(NioTlsWebSocketMessageChannel.java:282)
at gov.nist.javax.sip.stack.NioTcpMessageChannel.readChannel(NioTcpMessageChannel.java:121)
at gov.nist.javax.sip.stack.NioTcpMessageProcessor$ProcessorTask.read(NioTcpMessageProcessor.java:154)
at gov.nist.javax.sip.stack.NioTcpMessageProcessor$ProcessorTask.run(NioTcpMessageProcessor.java:344)
at java.lang.Thread.run(Thread.java:745)
属性:
SipStack
我正在使用properties.setProperty("javax.sip.STACK_NAME", s"im.dlg.sip:$localAddress:$transport")
properties.setProperty("javax.sip.AUTOMATIC_DIALOG_SUPPORT", "on") // must be on to leverage dialog usage!
properties.setProperty("gov.nist.javax.sip.DELIVER_RETRANSMITTED_ACK_TO_LISTENER", "true")
properties.setProperty("gov.nist.javax.sip.REENTRANT_LISTENER", "false")
properties.setProperty("gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY", "gov.nist.javax.sip.stack.NioMessageProcessorFactory")
properties.setProperty("gov.nist.javax.sip.THREAD_POOL_SIZE", "10")
。