Adds detection for SIP redirect loops.

cusax-fix
Emil Ivov 14 years ago
parent e872b16701
commit 2964ade25a

@ -511,12 +511,29 @@ public boolean processResponse(ResponseEvent responseEvent)
return true;
}
Address redirectAddress = contactHeader.getAddress();
//try to detect an immediate loop.
if( callPeer.getPeerAddress().getURI().equals
(redirectAddress.getURI()) )
{
logger.error("Redirect loop detected for: "
+ callPeer.getPeerAddress().getURI());
callPeer.setState(CallPeerState.FAILED,
"Redirect loop detected for: "
+ callPeer.getPeerAddress().getURI());
return true;
}
//first start a call to the new address then end the old
//one.
CallSipImpl call = callPeer.getCall();
try
{
call.invite(contactHeader.getAddress(), null);
call.invite(redirectAddress, null);
}
catch (OperationFailedException exc)
{

Loading…
Cancel
Save