Dialogic Dialogic Global Call IP IP Phone User Manual


 
454 Dialogic
®
Global Call IP Technology Guide — November 2007
Dialogic Corporation
When retrieving called party (DNIS) information, the address is taken from the SIP To: header, and
is accessible in one of two forms by using one of the following parameter IDs in the function call:
DESTINATION_ADDRESS
Returns the simple destination address in the form
user@127.0.0.1
DESTINATION_ADDRESS_SIP
Returns a SIP-specific destination address that includes additional To URI parameters in the
form
sip: userB@127.0.0.1;user=Steve
When retrieving Call ID information, the buffer pointed to by the valuep argument contains a
NULL-terminated string. The maximum size of this string is IP_SIP_CALLIDSIZE bytes. To
assure adequate buffer size when the protocol is unknown, use the IP_CALLIDSIZE define. This
will assure the buffer is large enough to hold any type of Call ID value (i.e., either H.323 or SIP).
Retrieving SIP Call ID via gc_GetCallInfo( )
The following code example illustrates retrieval of the SIP Call ID using a gc_GetCallInfo( ) call.
/*
* Assume the following has been done:
* 1. device has been opened (e.g. :N_iptB1T1:P_SIP, :N_iptB1T2:P_SIP, etc...)
* 2. gc_WaitCall() has been issued to wait for a call.
* 3. gc_GetMetaEvent() or gc_GetMetaEventEx() (Windows) has been called
* to convert the event into metaevent.
* 4. a GCEV_OFFERED has been detected.
*/
#include <stdio.h>
#include <srllib.h>
#include <gclib.h>
#include <gcerr.h>
#include <gcip.h>
/*
* Assume the 'crn' parameter holds the CRN associated with the detected GCEV_OFFERED event.
*/
int print_call_info(CRN crn)
{
GC_INFO gc_error_info; /* GlobalCall error information data */
char cid_buff[IP_SIP_CALLIDSIZE]; /* buffer large enough to hold SIP Call-ID value */
if(gc_GetCallInfo(crn, IP_CALLID, cid_buff) != GC_SUCCESS)
{
/* process error return as shown */
gc_ErrorInfo( &gc_error_info );
printf ("Error: gc_GetCallInfo(IP_CALLID) on crn: 0x%lx, GC ErrorValue: 0x%hx - %s,"\
" CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n",
crn, gc_error_info.gcValue, gc_error_info.gcMsg, gc_error_info.ccLibId,
gc_error_info.ccLibName, gc_error_info.ccValue, gc_error_info.ccMsg);
return (gc_error_info.gcValue);
}
printf ("gc_GetCallInfo(IP_CALLID) on crn: 0x%lx, returned - %s\n", crn, cid_buff);
return(0);
}