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_InitXfer( ) — initiate a supervised transfer<br />

Additional result values for GCEV_INIT_XFER_REJ include:<br />

GCRV_REMOTEREJ_NOTALLOWED<br />

remote rejected; service not allowed<br />

GCRV_REMOTEREJ_NOTSUBSCRIBED<br />

remote rejected; user is not subscribed<br />

GCRV_REMOTEREJ_UNAVAIL<br />

remote rejected; service unavailable<br />

GCRV_REMOTEREJ_UNSPECIFIED<br />

remote rejected; reason not given<br />

Example<br />

#include <br />

#include <br />

#include <br />

#include <br />

#include <br />

#include <br />

#define MAX_CHAN 30 /* maximum number of channels in system */<br />

/*<br />

* Data structure which stores all information for each line<br />

*/<br />

static struct linebag {<br />

LINEDEV ldev; /* <strong>Global</strong> <strong>Call</strong> <strong>API</strong> line device handle */<br />

CRN crn; /* <strong>Global</strong> <strong>Call</strong> <strong>API</strong> call handle */<br />

CRN consultation_crn; /* <strong>Global</strong> <strong>Call</strong> <strong>API</strong> call handle */<br />

int blocked; /* channel blocked/unblocked */<br />

} port[MAX_CHAN+1];<br />

struct linebag *pline; /* pointer to access line device */<br />

/*<br />

* Assume the following have been done:<br />

* 1. Opened line devices for each time slot on the network interface board.<br />

* 2. Each line device is stored in linebag structure "port".<br />

* 3. The consultation call has been established between Transferring party A and<br />

* Transferred-To party C and the call is in connected or on hold state.<br />

*/<br />

int initiate_calltransfer(int port_num)<br />

{<br />

GC_INFO gc_error_info; /* <strong>Global</strong> <strong>Call</strong> error information data */<br />

GC_PARM_BLK * gc_pRetParmBlk = NULL; /* Returned the GC_PARM_BLK */<br />

}<br />

/* Find info for this time slot, specified by 'port_num' */<br />

/* (assumes port_num is valid) */<br />

pline = port + port_num;<br />

/* Initiate the call transfer request */<br />

if (gc_InitXfer(pline->crn, &gc_pRetParmBlk, NULL, EV_ASYNC) == -1)<br />

{<br />

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

gc_ErrorInfo( &gc_error_info );<br />

printf ("Error: gc_InitXfer() on device handle: 0x%lx, GC ErrorValue: 0x%hx - %s,<br />

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

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

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

return (gc_error_info.gcValue);<br />

}<br />

return (0);<br />

212 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!