I am trying to send notify to an endpoint having IPV6 address. But getting an exception.
Exception javax.sip.SipException: Cannot assign requested address: Datagram send failed
After doing some search i found that destination might be invalid but thats not the case.I can ping it.
here is the part of the code.
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));
}
And this is the Notify request headers:
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
If i use IPV4 address instead of IPV6 then it works perfectly fine.
I am sorry i have hidden the names since i dont want to disclose it but same names are working with IPV4.
It will be great if i can get some idea why this is happening.
Edit : I am using jain SIP version 1.2