HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
Authentication 205
Server Authentication Implementation
/*=========================================================================================*/
RvChar* g_strSrvAuthRealm = "HP Realm";
void AppAuthCredentialsFoundEv(
IN RvSipCallLegHandle hCallLeg,
IN RvSipAppCallLegHandle hAppCallLeg,
IN RvSipTranscHandle hTransc,
IN RvSipAuthorizationHeaderHandle hAuthorization,
IN RvBool bCredentialsSupported)
{
RvStatus rv;
RvChar strName[50], strRealm[50], strNonce[50];
RvChar strPW[50];
RvInt32 actualLen;
RvBool toSkip = RV_FALSE;
if(bCredentialsSupported == RV_FALSE)
{
printf("Unknown Algorithm or scheme. skip header.");
toSkip = RV_TRUE;
}
else
{
/*-------------------------------------------------------------------------------------
Gets the realm, username and nonce parameters from the given credentials and checks if
they fit.
-------------------------------------------------------------------------------------*/
rv = RvSipAuthorizationHeaderGetCredentialIdentifier(
hAuthorization,
strRealm, 50,
strName, 50,
strNonce, 50,
&actualLen,
&actualLen,
&actualLen);
if(rv != RV_OK)
{
printf("Couldn't get credentials Identifiers from authorization header. skip
header.");
toSkip = RV_TRUE;
}