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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

gc_OpenEx( ) — open a <strong>Global</strong> <strong>Call</strong> device and set a user-defined attribute<br />

}<br />

gc_ErrorInfo( &gc_error_info );<br />

printf ("Error: %s(), GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s,<br />

CC ErrorValue: 0x%lx - %s\n",<br />

function, gc_error_info.gcValue, gc_error_info.gcMsg,<br />

gc_error_info.ccLibId, gc_error_info.ccLibName,<br />

gc_error_info.ccValue, gc_error_info.ccMsg);<br />

return (gc_error_info.gcValue);<br />

/*<br />

* int evt_hdlr (void)<br />

*<br />

* RETURN: 0 - function successful<br />

* error - <strong>Global</strong><strong>Call</strong> error number<br />

*<br />

*/<br />

int evt_hdlr(void)<br />

{<br />

struct channel *pline;<br />

int error; /* reason for failure of function */<br />

METAEVENT metaevent;<br />

}<br />

if (gc_GetMetaEvent(&metaevent) != GC_SUCCESS) {<br />

/* process error return as shown */<br />

error = print_error("gc_GetMetaEvent");<br />

return(error);<br />

}<br />

if (metaevent.flags & GCME_GC_EVENT) {<br />

/* process <strong>Global</strong><strong>Call</strong> events */<br />

if (gc_GetUsrAttr(metaevent.linedev, (void **)&pline) != GC_SUCCESS) {<br />

/* process error return as shown */<br />

error = print_error("gc_GetUsrAttr");<br />

return(error);<br />

}<br />

switch (metaevent.evttype) {<br />

case GCEV_UNBLOCKED:<br />

printf("received GCEV_UNBLOCKED event on %s\n", ATDV_NAMEP(pline->networkh));<br />

pline->blocked = 0;<br />

break;<br />

default:<br />

printf ("Unexpected <strong>Global</strong><strong>Call</strong> event received\n");<br />

break;<br />

}<br />

}<br />

else {<br />

/* process other events */<br />

}<br />

return 0;<br />

/*<br />

* int open_line_devices (void)<br />

*<br />

* RETURN: 0 - function successful<br />

* error - <strong>Global</strong><strong>Call</strong> error number<br />

*<br />

*/<br />

int open_line_devices(void)<br />

{<br />

char devname[64]; /* argument to gc_OpenEx() function */<br />

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

Dialogic Corporation

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

Saved successfully!

Ooh no, something went wrong!