我正在尝试向具有 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 版