如何使用RestComm JDiameter从服务器向客户端发送Diameter请求消息

时间:2017-04-29 11:24:25

标签: restcomm diameter-protocol

我正在实施Diameter应用程序,其中服务器在客户端连接到服务器之后将请求消息发送到客户端,然后成功进行CER / CEA交换。

我构建消息并将其发送到客户端到同一主机,但是我收到以下错误:

org.jdiameter.api.RouteException: Unable to find valid connection to peer[aaa://10.0.2.15:44819] in realm[exchange.example.org]

服务器端配置如下:

<Configuration xmlns="http://www.jdiameter.org/jdiameter-server">
<LocalPeer>
    <URI value="aaa://10.0.2.16:3868" />
    <IPAddresses>
        <IPAddress value="10.0.2.16" />
    </IPAddresses>
    <Realm value="exchange.example.org" />
    <VendorID value="10415" />
    <ProductName value="jDiameter" />
    <FirmwareRevision value="1" />
    <Applications>
        <ApplicationID>
            <VendorId value="10415" />
            <AuthApplId value="16777346" />
            <AcctApplId value="0" />
        </ApplicationID>
    </Applications>
</LocalPeer>

<Parameters>
    <AcceptUndefinedPeer value="true" />
    <DuplicateProtection value="true" />
    <DuplicateTimer value="240000" />
    <UseUriAsFqdn value="false" />
    <QueueSize value="10000" />
    <MessageTimeOut value="60000" />
    <StopTimeOut value="10000" />
    <CeaTimeOut value="10000" />
    <IacTimeOut value="30000" />
    <DwaTimeOut value="10000" />
    <DpaTimeOut value="5000" />
    <RecTimeOut value="10000" />
    <Concurrent>
        <Entity name="ThreadGroup" size="64" />
        <Entity name="ProcessingMessageTimer" size="1" />
        <Entity name="DuplicationMessageTimer" size="1" />
        <Entity name="RedirectMessageTimer" size="1" />
        <Entity name="PeerOverloadTimer" size="1" />
        <Entity name="ConnectionTimer" size="1" />
        <Entity name="StatisticTimer" size="1" />
    </Concurrent>

</Parameters>

<Network>
    <Peers>
        <Peer name="aaa://10.0.2.35:3868" attempt_connect="false" rating="1" />
    </Peers>
    <Realms>
        <Realm name="exchange.example.org" peers="10.0.2.15" local_action="LOCAL" dynamic="true" exp_time="100">
            <ApplicationID>
                <VendorId value="10415" />
                <AuthApplId value="16777346" />
                <AcctApplId value="0" />
            </ApplicationID>
        </Realm>
    </Realms>
</Network>

处理连接建立和发送请求消息的源代码如下:

MutablePeerTable mutablePeerTable = stack.unwrap(MutablePeerTable.class);
mutablePeerTable.setPeerTableListener(new PeerTableListener() {
    @Override
    public void peerAccepted(Peer peer) {
        ApplicationId appId = ApplicationId.createByAuthAppId(VENDOR_ID,
                APP_ID);

        String destHost = peer.getUri().toString();
        Request r = session.createRequest(CONNECTION_MANAGEMENT_REQUEST,
                appId, peer.getRealmName(), destHost);

        Session session = this.factory.getNewSession("1233456");
        session.send(r, this);
    }

    @Override
    public void peerRemoved(Peer peer) {
        log.info("Peer Removed");
    }
});

这是从服务器向客户发送Diameter请求的正确方法吗?

0 个答案:

没有答案