HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
144 HP-UX C SIP Stack Programmer’s Guide
Initiating a Register-Client
To initiate a Register-Client
1. Declare a handle to the new register-client.
2. Define the To, From, Registrar and Contact addresses as
strings.
3. Call the RvSipRegClientMgrCreateRegClient() function.
This enables you to exchange handles with the SIP Stack.
4. Call the RvSipRegClientMake() function, supplying the handle
to the register-client and the string addresses defined in step 3.
Calling this function sends a REGISTER request to the
requested Registrar.
Note The RvSipRegClientMake() function lets you set only one
contact header. If you want to set more than one contact, call the
RvSipRegClientSetContactHeader() function before calling the
make function.
Sample Code (next page)
/*==========================================================================*/
void AppSimpleRegister(
IN RvSipRegClientMgrHandle hRegClientMgr)
{
RvStatus rv;
/*---------------------------------------------------
1. Declares a handle to the new register-client.
----------------------------------------------------*/
RvSipRegClientHandle hRegClient;
/*----------------------------------------------------
2. Defines the To, From, Registrar, and Contact addresses
as strings.
----------------------------------------------------*/
RvChar *strFrom = "From:sip:172.20.3.38";
RvChar *strTo = "To:sip:me@172.20.2.151";
RvChar *strContact = "Contact:sip:172.20.3.38";
RvChar *strRegistrar ="sip:172.20.2.151";
/*---------------------------------------------------