added the possibility to cache authorization headers

cusax-fix
Emil Ivov 19 years ago
parent 8095eecd9d
commit 6732adc0ef

@ -259,6 +259,17 @@ else if (challenge.getStatusCode()
logger.debug("Created authorization header: " +
authorization.toString());
// get the unique Call-ID
CallIdHeader call = (CallIdHeader)reoriginatedRequest
.getHeader(CallIdHeader.NAME);
if(call != null)
{
String callid = call.getCallId();
cachedCredentials
.cacheAuthorizationHeader (callid, authorization);
}
reoriginatedRequest.addHeader(authorization);
}
@ -493,4 +504,18 @@ private CredentialsCacheEntry createCcEntryWithStoredPassword(
return ccEntry;
}
/**
* Returns an authorization header cached against the specified
* <tt>callID</tt> or <tt>null</tt> if no auth. header has been previously
* cached for this callID.
*
* @param callID the ID of the call that we'd like to reString
* @return the <tt>AuthorizationHeader</tt> cached against the specified
* call ID or null if no such header has been cached.
*/
public AuthorizationHeader getCachedAuthorizationHeader(String callID)
{
return this.cachedCredentials.getCachedAuthorizationHeader(callID);
}
}

Loading…
Cancel
Save