HP-UX C SIP Stack Programmer's Guide (Novembery 2007)

Authentication 201
Server Authentication Implementation
SERVER
A
UTHENTICATION
F
UNCTIONS AND
C
ALLBACKS
Server authentication may be implemented above the Call-leg, Subscription or
Transaction layers (for proxies). Because of this, there are three sets of
functions, one for each layer.
C
ALL-LEG SERVER
A
UTHENTICATION
F
UNCTIONS
The following functions are used for Call-leg server authentication:
RvSipCallLegAuthBegin()
Begins the server authentication process. This function may be called in any of
the following states which indicate that a new request was received:
RVSIP_CALL_LEG_STATE_OFFERING—authenticates an
INVITE request
RVSIP_CALL_LEG_MODIFY_STATE_REINVITE_RCVD
—authenticates re-INVITE request
RVSIP_CALL_LEG_REFER_STATE_REFER_RCVD—
authenticates a REFER request
Inside the RvSipCallLegTrancRequestRcvdEv callback
function—to authenticate a general request
RvSipCallLegAuthProceed()
Proceeds with the server authentication process. This function should be called
after the RvSipCallLegCredentialsFoundEv callback was called (see below). In
this function you may choose to proceed with one of four actions:
Instruct the SIP Stack to authenticate the credentials, suppling it
with a suitable password.
Skip the given credentials and instruct the SIP Stack to search
for the next credentials. (Use this option if you are not familiar
with the realm or username found in the given credentials.)
Finish the authentication process with Success indication.
Finish the authentication process with Failure indication.
RvSipCallLegRespondUnauthenticated()
Responds with a 401 or 407 message. This function gets an already-built header
(Authentication header or Other header), and sets it in the response message.