08.01.2013 Views

Dialogic® Global Call API Library Reference

Dialogic® Global Call API Library Reference

Dialogic® Global Call API Library Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

{<br />

}<br />

update the configuration data — gc_SetConfigData( )<br />

case GCTGT_PROTOCOL_CHAN:<br />

case GCTGT_FIRMWARE_CHAN:<br />

/* If the target object is a line device (time slot or network interface) */<br />

pline = port + port_num;<br />

target_id = pline->ldev;<br />

break;<br />

default:<br />

/* Otherwise: return -1 */<br />

printf("Unsupported target type: 0x%lx\n", target_type);<br />

return -1;<br />

break;<br />

/* <strong>Call</strong> gc_SetConfigData() function */<br />

result = gc_SetConfigData(target_type, target_id, parm_blkp, 0, update_flag,<br />

request_idp, mode);<br />

if (result != GC_SUCCESS)<br />

{<br />

/* retrieve error values by calling gc_ErrorInfo */<br />

if (gc_ErrorInfo(&t_gcinfo) == GC_SUCCESS)<br />

{<br />

printf("Error on target type: 0x%lx, target ID: 0x%lx\n", target_type,<br />

target_id);<br />

printf("with GC Error 0x%xh: %s\n", t_gcinfo.gcValue, t_gcinfo.gcMsg);<br />

printf("CCLib %d(%s) Error - 0x%xh: %s\n", t_gcinfo.ccLibId,<br />

t_gcinfo.ccLibName, t_gcinfo.ccValue, t_gcinfo.ccMsg);<br />

printf("Additional message: %s\n", t_gcinfo.additionalInfo);<br />

}<br />

else<br />

{<br />

printf("gc_ErrorInfo() failure");<br />

}<br />

}<br />

return result;<br />

int main()<br />

int port_num = 0;<br />

long request_id = 0;<br />

long long_value;<br />

/* To call the GC PARM utility function to insert a parameter,<br />

the pointer to GC_PARM_BLK must be initialized to NULL */<br />

GC_PARM_BLK * parm_data_blkp = NULL;<br />

/* First call GC PARM utility function to insert the parameters used to be<br />

updated */<br />

/* 1. insert set call event mask parm */<br />

long_value = GCMSK_DETECTED | GCMSK_DIALING | GCMSK_FATALERROR | GCMSK_UNBLOCKED;<br />

gc_util_insert_parm_val(&parm_data_blkp, GCSET_CALLEVENT_MSK, GCACT_SETMSK,<br />

sizeof(long), long_value);<br />

/* 2. insert set call state mask parm */<br />

long_value = GCMSK_PROCEEDING_STATE | GCMSK_SENDMOREINFO_STATE |<br />

GCMSK_GETMOREINFO_STATE | GCMSK_CALLROUTING_STATE;<br />

gc_util_insert_parm_val(&parm_data_blkp, GCSET_CALLSTATE_MSK, GCACT_SETMSK,<br />

sizeof(long), long_value);<br />

/* after creating the GC_PARM_BLK, call set_configuration function to set the target<br />

object with the data block */<br />

set_configuration(GCTGT_GCLIB_CHAN, port_num, parm_data_blkp, GCUPDATE_IMMEDIATE,<br />

&request_id, EV_SYNC);<br />

Dialogic ® <strong>Global</strong> <strong>Call</strong> <strong>API</strong> <strong>Library</strong> <strong>Reference</strong> — January 2008 323<br />

Dialogic Corporation

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!