Dialogic Dialogic Global Call IP IP Phone User Manual


 
328
Dialogic Corporation
4.26.8 Sending a Request to Switch from T.38 Fax to Audio
To request a switch from a T.38 Fax session back to an audio session, the application uses the
gc_Extension( ) function, which initiates a RequestMode (H.323) or re-INVITE (SIP) message to
actually perform the action. Before initiating the change of coder, the Fax device must be
disassociated from the Media device using the gc_SetUserInfo( ) function. The application
receives a GCEV_EXTENSION event to indicate that audio can now be sent and received. The
following code provides and example:
INT32 switchFromFaxToAudio()
{
GC_PARM_BLK *parmblkp = NULL;
IP_CONNECT ipConnect;
ipConnect.version = 0x100;
ipConnect.mediaHandle = pline->mediaH;
gc_util_insert_parm_ref(&parmblkp, IPSET_FOIP, IPPARM_T38_DISCONNECT,
(sizeof(IP_CONNECT)), (void *)(&ipConnect));
gc_SetUserInfo(GCTGT_GCLIB_CRN, pline->crn, parmblkp, GC_SINGLECALL);
gc_util_delete_parm_blk(parmblkp);
/* Initiate audio codec switch */
gc_util_insert_parm_ref(&parmblkp, IPSET_SWITCH_CODEC,
IPPARM_AUDIO_INITIATE, sizeof(int), NULL);
gc_Extension(GCTGT_GCLIB_CRN,pline->crn, IPEXTID_CHANGEMODE, parmblkp, NULL, EV_ASYNC);
gc_util_delete_parm_blk(parmblkp);
}
INT32 processEvtHandler()
{
METAEVENT metaEvent;
GC_PARM_BLK *parmblkp = NULL;
:
switch (evtType)
{
case GCEV_EXTENSIONCMPLT:
/* received extension complete event for audio initiation*/
/* do nothing */
break;
case GCEV_EXTENSION:
/* received extension event for media readiness */
ext_evtblkp = (EXTENSIONEVTBLK *) metaEvent.extevtdatap;
parmblkp = &ext_evtblkp->parmblk;
while (t_gcParmDatap = gc_util_next_parm(parmblkp, t_gcParmDatap))
{
switch(t_gcParmDatap->set_ID)
{
case IPSET_SWITCH_CODEC:
switch(t_gcParmDatap->parm_ID)
{
case IPPARM_READY:
/* Ready to send and receive audio */
gc_Listen();
break;
:
:
}
break;
}
}