Dialogic Dialogic Global Call IP IP Phone User Manual


 
4.13.4 Responding to an INFO Message
Once an application has received a GCEV_CALLINFO event for a SIP INFO message and
extracted the information from the event, it must send a response message.
The response is sent by passing a GC_PARM_BLK containing the following parameter element to
the function:
IPSET_MSG_SIP
IPPARM_MSGTYPE
and one of the following parameter values:
IP_MSGTYPE_SIP_INFO_OK
IP_MSGTYPE_SIP_FAILED
In addition, the application can set a specific SIP response code in the response message using the
following parameter element:
IPSET_MSG_SIP
IPPARM_MSG_SIP_RESPONSE_CODE
and one of the following values:
For an “OK” response, the value should be in the range 200 to 299; if the application does
not set this parameter, the Dialogic
®
Global Call API library fills in the default value 200.
For a “Failed” response, the value should be 300 or higher; if the application does not set
this parameter, the Dialogic
®
Global Call API library fills in the default value 501.
The following two code snippets illustrate how an application would send “OK” and “Failed”
responses to INFO messages.
“OK” Response to INFO Message
// inbound SIP INFO request has been received
// reply to INFO with an OK
gc_util_insert_parm_val(&parmblkp,
IPSET_MSG_SIP,
IPPARM_MSGTYPE,
sizeof(int),
IP_MSGTYPE_SIP_INFO_OK);
// Insert SIP response code
gc_util_insert_parm_val(&parmblkp,
IPSET_MSG_SIP,
IPPARM_MSG_SIP_RESPONSE_CODE,
sizeof(int),
200);
// transmit INFO response message to network
retval = gc_Extension(GCTGT_GCLIB_CRN, crn, IPEXTID_SENDMSG, parmblkp, &retblkp, EV_ASYNC);
“Failed” Response to INFO Message
// application has just received an inbound SIP INFO request.
// in this case, we are sending a "Not Implemented" failure response