use of net.java.sipmack.sip.security.SipSecurityException in project Spark by igniterealtime.
the class MessageProcessing method processAuthenticationChallenge.
/**
* Attempts to re-generate the corresponding request with the proper
* credentials and terminates the call if it fails.
*
* @param clientTransaction the corresponding transaction
* @param response the challenge
*/
void processAuthenticationChallenge(ClientTransaction clientTransaction, Response response) {
try {
ClientTransaction retryTran = sipManCallback.sipSecurityManager.handleChallenge(response, clientTransaction);
retryTran.sendRequest();
} catch (SipSecurityException exc) {
sipManCallback.fireCommunicationsError(new CommunicationsException("Authorization failed!", exc));
} catch (Exception exc) {
sipManCallback.fireCommunicationsError(new CommunicationsException("Failed to resend a request " + "after a security challenge!", exc));
} finally {
}
}
use of net.java.sipmack.sip.security.SipSecurityException in project Spark by igniterealtime.
the class RegisterProcessing method processAuthenticationChallenge.
/**
* Attempts to re-generate the corresponding request with the proper
* credentials and terminates the call if it fails.
*
* @param clientTransaction the corresponding transaction
* @param response the challenge
*/
void processAuthenticationChallenge(ClientTransaction clientTransaction, Response response) {
try {
ClientTransaction retryTran = sipManCallback.sipSecurityManager.handleChallenge(response, clientTransaction);
retryTran.sendRequest();
return;
} catch (SipSecurityException exc) {
// tell the others we couldn't register
sipManCallback.fireUnregistered(((FromHeader) clientTransaction.getRequest().getHeader(FromHeader.NAME)).getAddress().toString());
sipManCallback.fireCommunicationsError(new CommunicationsException("Authorization failed!", exc));
} catch (Exception exc) {
// tell the others we couldn't register
sipManCallback.fireUnregistered(((FromHeader) clientTransaction.getRequest().getHeader(FromHeader.NAME)).getAddress().toString());
sipManCallback.fireCommunicationsError(new CommunicationsException("Failed to resend a request " + "after a security challenge!", exc));
}
}
use of net.java.sipmack.sip.security.SipSecurityException in project Spark by igniterealtime.
the class CallProcessing method processAuthenticationChallenge.
/**
* Attempts to re-ogenerate the corresponding request with the proper
* credentials and terminates the call if it fails.
*
* @param clientTransaction the corresponding transaction
* @param response the challenge
*/
void processAuthenticationChallenge(ClientTransaction clientTransaction, Response response) {
try {
ClientTransaction retryTran = sipManCallback.sipSecurityManager.handleChallenge(response, clientTransaction);
// There is a new dialog that will be started with this request. Get
// that dialog and record it into the Call objet for later use (by
// Bye-s for example).
Call call = callDispatcher.findCall(clientTransaction.getDialog());
call.setDialog(retryTran.getDialog());
call.setInitialRequest(retryTran.getRequest());
retryTran.sendRequest();
} catch (SipSecurityException exc) {
callDispatcher.findCall(clientTransaction.getDialog()).setState(Call.FAILED);
sipManCallback.fireCommunicationsError(new CommunicationsException("Authorization failed!", exc));
} catch (Exception exc) {
callDispatcher.findCall(clientTransaction.getDialog()).setState(Call.FAILED);
sipManCallback.fireCommunicationsError(new CommunicationsException("Failed to resend a request " + "after a security challenge!", exc));
}
}
Aggregations