【问题标题】:How to detect SCTP connection failuer如何检测 SCTP 连接失败
【发布时间】:2015-06-19 14:40:17
【问题描述】:

我正在使用 mobicents CAP 实现为 CAMEL 充电构建 CAP 应用程序;我的应用程序运行良好,我可以在 SSF 和 SCF 之间发送和接收消息。 我正在寻找的是:如何检测客户端和服务器之间的 SCTP 链接已断开?因为当我故意停止服务器并保持客户端运行时,发送CAPDialog 不会引发任何错误。

当我停止服务器时,在控制台上我看到以下异常:

2015-04-14 13:15:29,669 [Thread-0 ] ERROR org.mobicents.protocols.sctp.SelectorThread - Exception while finishing connection for Association=clientAsscoiation
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.mobicents.protocols.sctp.SelectorThread.finishConnectionTcp(SelectorThread.java:407)
    at org.mobicents.protocols.sctp.SelectorThread.finishConnection(SelectorThread.java:368)
    at org.mobicents.protocols.sctp.SelectorThread.run(SelectorThread.java:151)
    at java.lang.Thread.run(Unknown Source)

在此期间,如果我尝试发送 CAPDialog,例如发送一个 oAnswer 事件,它不会告诉请求是否成功(理想情况下应该返回失败)

OAnswerSpecificInfo oAnswerSpecificInfo = this.getCapProvider().getCAPParameterFactory().createOAnswerSpecificInfo(null,
                    false, false, null, null, null);
ReceivingSideID legID = this.getCapProvider().getCAPParameterFactory().createReceivingSideID(LegType.leg2);
MiscCallInfo miscCallInfo = this.getCapProvider().getINAPParameterFactory().createMiscCallInfo(MiscCallInfoMessageType.notification, null);
EventSpecificInformationBCSM eventSpecificInformationBCSM = this.getCapProvider()
                    .getCAPParameterFactory()
                    .createEventSpecificInformationBCSM(oAnswerSpecificInfo);

 CAPDialogCircuitSwitchedCall capDialog = (CAPDialogCircuitSwitchedCall) getCapProvider().getCAPDialog(localDialogId);

 capDialog.addEventReportBCSMRequest(EventTypeBCSM.oAnswer, eventSpecificInformationBCSM, legID, miscCallInfo, null);
 capDialog.setUserObject(getParamAsString("referenceId"));
 capDialog.setReturnMessageOnError(true);
 capDialog.send();

【问题讨论】:

    标签: java sctp cap mobicents


    【解决方案1】:

    "capDialog.send();"即使任何底层 SS7 链接断开,代码也不会返回错误。

    如果您有权访问 SCTP 堆栈,则可以检查 SCTP 连接是打开还是关闭: 协会协会 = ...; 关联.isConnected();

    【讨论】:

    • 我明白了,请让我检查一下。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-12-28
    • 2020-08-18
    • 2011-06-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多