DivaSDKJerryPangFAEAPACMay2007CompanyConfidential•2006copyrightEiconNetworksCorporation©Allrightsreserved.()DivaEventCallConnectedDivaReportDTMF(true)DivaSendVoiceFile()AppSDKDivaSetDTMFProcessingRules()DivaEventDTMFReceivedorOtherDivaDTMFruleEventsCompanyConfidential•2006copyrightEiconNetworksCorporation©Allrightsreserved.()DivaSetCallTypeFax()如果DTMF收到的是’X’DivaEventCallConected再次收到此事件DivaReceiveFax()AppSDKDivaEventFaxPageReceivedDivaEventFaxReceivedDivaEventCallDisconnectedDivaCloseCall()CompanyConfidential•2006copyrightEiconNetworksCorporation©Allrightsreserved.()DivaEventCallConnectedDivaSendVoiceFile()SDKAPPDivaSetDTMFProcessingRules()DivaEventDTMFReceivedorOtherDivaDTMFruleEventsDivaReportDTMF(true)CompanyConfidential•2006copyrightEiconNetworksCorporation©Allrightsreserved.()DivaSetCallTypeFax()如果DTMF收到的是’Y’DivaEventCallConected再次收到此事件DivaSendFax()SDKAPPDivaEventFaxPageSentDivaEventFaxSentDivaEventCallDisconnectedDivaCloseCall()DivaDisconnect()CompanyConfidential•2006copyrightEiconNetworksCorporation©Allrightsreserved.呼出流程(fax)DivaConnectFax()DivaEventCallConnectedSDKAPPDivaSendFax()CompanyConfidential•2006copyrightEiconNetworksCorporation©Allrightsreserved.()DivaDisconnect()CompanyConfidential•2006copyrightEiconNetworksCorporation©Allrightsreserved.呼出流程(拨分机)DivaConnectVoice()DivaEventCallConnectedDivaSendVoiceFile()【可选】SDKAPPDivaEventSendVoiceDoneDivaSendDTMF(“分机号码”)DivaReportDTMF(TRUE)注*这里调用DivaSendVoice()然后等到收到DivaEventSendVoiceDone之后才发送分机号,主要可以起到定时器的作用。因为交换机的不同可能会因为过快的发送分机号而转接失败。例如发送一个10秒的语音文件,则在10秒后才会发送分机号。同样可以用DivaStartCallTimer()来实现同样的的功能。DivaEventSendDTMFToneEndedCompanyConfidential•2006copyrightEiconNetworksCorporation©Allrightsreserved.呼出流程(拨分机)DivaEventDTMFReceivedDivaSetCallTypeFax()如果DTMF收到的是’Y’DivaEventCallConected再次收到此事件DivaSendFax()SDKAPPDivaEventFaxPageSentDivaEventFaxSentDivaEventCallDisconnectedDivaCloseCall()DivaDisconnect()CompanyConfidential•2006copyrightEiconNetworksCorporation©Allrightsreserved.一、声明ClassCCall{BOOLb_Used;charm_CallerID[30];charm_DTMF[30];DivaCallHandlem_hDivaCall;};CCall*pCall[4];voidMyCallBack(DivaAppHandleApp,DivaEventEvt,PVOIDPara1,PVOIDPara2);CompanyConfidential•2006copyrightEiconNetworksCorporation©Allrightsreserved.()DivaRegister(EventCallBack,MyCallBack);DivaListen()//可选初始化CompanyConfidential•2006copyrightEiconNetworksCorporation©Allrightsreserved.(DivaAppHandleApp,DivaEventEvt,PVOIDPara1,PVOIDPara2){switch(Evet){caseDivaEventIncomingCall:ProcessInComingCall(Para1,Para2);caseDivaEventCallConnected:ProcessConnected(Para1,Para2);caseDivaEventDTMFReceived:ProcessDTMF(Para1,Para2);caseDivaEventSendVoiceFileDone:ProcessSendVoiceDone(Para1,Para2);caseDivaEventFaxPageSent:ProcessFaxPageSent(Para1,Para2);caseDivaEventFaxSent:ProcessFaxSent(Para1,Para2);caseDivaEventCallDisconnected:ProcecessDisconnect(Para1,Para2);default:break;}CompanyConfidential•2006copyrightEiconNetworksCorporation©Allrightsreserved.(PVOIDPara1,PVOIDPara2){for(i=0;i4;i++){if(!pCall[i].b_Used)break;}pCall[i]-m_hDivaCall=(DivaCallHandle)Para1;DivaCallInfocallInfo;callInfo.size=sizeof(DivaCallInfo);DivaGetcallInfo(&callInfo);Strcpy(pCall[i].m_CallerID,callInfo.m_CallingNumber);DivaAnswer((DivaCallHandle)Para1,i);}CompanyConfidential•2006copyrightEiconNetworksCorporation©Allrightsreserved.(PVOIDPara1,PVOIDPara2){Inti=(int)Para1;DivaSendVoiceFile(pCall[i]-m_hDivaCall,”weclome.wav”);}VoidProcessCallConnected(PVOIDPara1,PVOIDPara2){Inti=(int)Para1;DivaSendFax(pCall[i]-m_hDivaCall,”test.tif”);//DivaReceiveFax(pCall[i]-m_hDivaCall,”rev.tif”);}CompanyConfidential•2006copyrightEiconNetworksCorporation©Allrightsreserved.(PVOIDPara1,PVOIDPara2){Inti=(int)Para1;charc=(char)Para2;if(c==‘#”)DivaRecordVoiceFile(pCall[i[.m_hDivaCall,”rec.wav”);elseif(c==‘X’)DivaSetCallTypeFax(pCall[i]-m_hDivaCall);elsepCall[i]-m_DTMF[]+=(char)Para2;//dosomethingwithreceivedDTMFs}CompanyConfidential•2006copyrightEiconNetworksCorporation©Allrightsreserved.(PVOIDPara1,PVOIDPara2){Inti=(int)Para1;DivaCloseCall(pCall[i]-m_hDivaCall);}Eicon,EiconNetworks,Diva,DivaandDialogicaretrademarksorregisteredtrademarksofEiconNetworksCorporationoritssubsidiaries.