# Registering a user

To register a user with the registrar, use nccRegisterUser.

## Prototype

DWORD NMSAPI nccRegisterUser ( CTAHD linehd, void *sipIEs)

Argument | Description
linehd | Line handle used to open the NCC service.
sipIEs | SIP information structure.

## SIP registration information structure

The following table lists the optional or required information elements (IEs):

Information element (IE) | Required or optional | Description
SIP_IE_TO_ADDRESS | Required | Name of the user who is registering.
SIP_IE_FROM_ADDRESS | Optional | Name of the user who is requesting the registration. If this From address is omitted, the To address is used.
SIP_IE_CONTACT_ADDRESS | Required | Address where the user can be contacted.
SIP_IE_REGISTRAR_ADDRESS | Required | Address of the registrar.
SIP_IE_EXPIRES_HEADER | Optional | Length of time that the registration is to last (in seconds). The default time is 3600 seconds.
SIP_IE_REGISTER_RENEW | Optional | If non-zero, SIP stack will start a timer and automatically renew the registration on the registrar before it expires.

## Example

NCC_SIP_INFO *ie;
NCC_SIP_INFO_INIT ( b, &ie );
NCC_SIP_INFO_ADD_STR ( b, &ie, SIP_IE_TO_ADDRESS, sip.to );
NCC_SIP_INFO_ADD_STR ( b, &ie, SIP_IE_CONTACT_ADDRESS, sip.contact );
NCC_SIP_INFO_ADD_STR ( b, &ie, SIP_IE_REGISTRAR_ADDRESS, sip.registrar );
NCC_SIP_INFO_ADD_NUM ( b, &ie, SIP_IE_EXPIRES_HEADER, 3600 );
nccRegisterUser( ctahd_cc, b);