无法使用IPV6地址向端点发送SIP通知

时间:2014-12-05 01:19:51

标签: java sip jain-sip

我正在尝试将通知发送到具有IPV6地址的端点。但得到例外。

Exception javax.sip.SipException: Cannot assign requested address: Datagram send failed

在做了一些搜索之后,我发现目的地可能无效但事实并非如此。我可以ping它。

这是代码的一部分。

   try{
        Request notifyRequest = notifyReqBuilder.createOutOfDialogNotify( deviceNumber, destination, destPort, isRestart);  
        if (notifyRequest == null)
        {
            logger.error(" Unable to create check-sync Notify Request");
        }
        // Create the client transaction.
        ClientTransaction trans= sipLayer.sipProvider.getNewClientTransaction(notifyRequest);
        trans.sendRequest(); // Send it out-of-dialog
        trans.setApplicationData(this); 
    }
    catch(Exception e){     
        this.logger.error("[SIP]: {}; {}", "Unable to send Notify Request", ExceptionUtil.toString(e));
    }

这是通知请求标题:

    NOTIFY sip:Unknown@[2620:0:60:c0e:1d20:38b7:3dc5:bf22]:5060 SIP/2.0
    Call-ID: 95b841f266c69074f380e93bd9c14c25@172.21.82.85
    CSeq: 1 NOTIFY
    From: <sip:abc@xx.xxxx.com>;tag=43d26359
    To: <sip:Unknown@[2620:0:60:c0e:1d20:38b7:3dc5:bf22]:5060>
    Via: SIP/2.0/UDP [2620:0:60:c00:59d9:d2ec:ee4a:f884]:5160;branch=z9hG4bK224d02bd0529e1b215bddfc002165660363434
    Max-Forwards: 20
    Contact: "xxxx" <sip:xxx@[2620:0:60:c00:59d9:d2ec:ee4a:f884]:5160>
    Subscription-State: terminated
    Event: check-sync
    Content-Length: 0

如果我使用IPV4地址而不是IPV6,那么它可以正常工作。

对不起,我隐藏了这些名字,因为我不想透露它,但同名的名字正在使用IPV4。

如果我能理解为什么会这样,那将会很棒。

编辑:我正在使用jain SIP 1.2版

1 个答案:

答案 0 :(得分:0)

发布完整堆栈跟踪和堆栈/ JVM属性。它必须与绑定地址有关。这很可能是OS或JVM问题。尝试从像netcat这样的独立测试工具重复ipv6连接来验证。操作系统中有许多设置会阻止ipv6连接尝试。