pjsip_cred_cb typedef

Type of callback function to create authentication response. Application can specify this callback in \a cb field of the credential info (#pjsip_cred_info) and specifying PJSIP_CRED_DATA_DIGEST_CALLBACK as \a data_type. When this function is called, most of the fields in the \a auth authentication response will have been filled by the framework. Application normally should just need to calculate the response digest of the authentication response.

@param pool Pool to allocate memory from if application needs to. @param chal The authentication challenge sent by server in 401 or 401 response, in either Proxy-Authenticate or WWW-Authenticate header. @param cred The credential that has been selected by the framework to authenticate against the challenge. @param auth The authentication response which application needs to calculate the response digest.

@return Application may return non-PJ_SUCCESS to abort the authentication process. When this happens, the framework will return failure to the original function that requested authentication.

Implementation

typedef pjsip_cred_cb = ffi.Pointer<
    ffi.NativeFunction<
        pj_status_t Function(
            ffi.Pointer<pj_pool_t> pool,
            ffi.Pointer<pjsip_digest_challenge> chal,
            ffi.Pointer<pjsip_cred_info> cred,
            ffi.Pointer<pj_str_t> method,
            ffi.Pointer<pjsip_digest_credential> auth)>>;