# Answering a call

To answer an incoming call, use nccAnswerCall.

#### Prototype

DWORD NMSAPI nccAnswerCall ( NCC_CALLHD callhd, unsigned num_rings, void *answerparms)

Argument | Description
callhd | Call handle returned to the application with the NCCEVN_SEIZURE_DETECTED event.
num_rings | Not used.
answerparms | Pointer to a SIP information structure. The answerparms data structure is a buffer that contains SIP IEs. Typically, this buffer contains SDP information choosing the codec and specifying the IP address and port that the called party uses.

#### Example

DWORD b[256];
NCC_SIP_INFO *ie;
NCC_SIP_INFO_INIT ( b, &ie );
NCC_SIP_INFO_ADD_STR ( b, &ie, SIP_IE_SDP_ORIGIN_USERNAME, "user" );
NCC_SIP_INFO_ADD_STR ( b, &ie, SIP_IE_SDP_ORIGIN_SESSION_ID, "01234567890" );
NCC_SIP_INFO_ADD_STR ( b, &ie, SIP_IE_SDP_ORIGIN_VERSION, "0987654321" );
NCC_SIP_INFO_ADD_STR ( b, &ie, SIP_IE_SDP_ORIGIN_ADDRESS, "<sip:user@192.162.2.2:5060>");
NCC_SIP_INFO_ADD_STR ( b, &ie, SIP_IE_SDP_SESSION_NAME, "NMS SIP" );
NCC_SIP_INFO_ADD_STR ( b, &ie, SIP_IE_SDP_CONNECTION_NET_TYPE, "IN" );
NCC_SIP_INFO_ADD_STR ( b, &ie, SIP_IE_SDP_CONNECTION_ADDR_TYPE, "IP4" );
NCC_SIP_INFO_ADD_STR ( b, &ie, SIP_IE_SDP_CONNECTION_ADDRESS, "192.168.2.2" );
NCC_SIP_INFO_ADD_NUM ( b, &ie, SIP_IE_SDP_MEDIA_TYPE, SDP_MEDIA_TYPE_AUDIO );
NCC_SIP_INFO_ADD_NUM ( b, &ie, SIP_IE_SDP_MEDIA_PORT, 8006 );
NCC_SIP_INFO_ADD_NUM ( b, &ie, SIP_IE_SDP_MEDIA_PROTOCOL, SDP_MEDIA_PROTOCOL_RTP );
NCC_SIP_INFO_ADD_NUM ( b, &ie, SIP_IE_SDP_ENCODING, 0 );
ret = nccAnswerCall( callhd, nrings, b );