1、,Diva SDK,Jerry Pang FAE APAC,May 2007,呼入流程,DivaEventIncomingCall,DivaAnswerVoice(),DivaEventCallConnected,DivaReportDTMF(true),DivaSendVoiceFile(),App,SDK,DivaSetDTMFProcessingRules(),DivaEventDTMFReceived or Other Diva DTMF rule Events,呼入流程,DivaStopSending(),DivaSetCallTypeFax() 如果DTMF收到的是X,DivaEv
2、entCallConected 再次收到此事件,DivaReceiveFax(),App,SDK,DivaEventFaxPageReceived,DivaEventFaxReceived,DivaEventCallDisconnected,DivaCloseCall(),呼出流程,DivaConnectVoice(),DivaEventCallConnected,DivaSendVoiceFile(),SDK,APP,DivaSetDTMFProcessingRules(),DivaEventDTMFReceived or Other Diva DTMF rule Events,DivaRe
3、portDTMF(true),呼出流程,DivaStopSending(),DivaSetCallTypeFax() 如果DTMF收到的是Y,DivaEventCallConected 再次收到此事件,DivaSendFax(),SDK,APP,DivaEventFaxPageSent,DivaEventFaxSent,DivaEventCallDisconnected,DivaCloseCall(),DivaDisconnect(),呼出流程(fax),DivaConnectFax(),DivaEventCallConnected,SDK,APP,DivaSendFax(),呼出流程,SDK
4、,APP,DivaEventFaxPageSent,DivaEventFaxSent,DivaEventCallDisconnected,DivaCloseCall(),DivaDisconnect(),呼出流程 (拨分机),DivaConnectVoice(),DivaEventCallConnected,DivaSendVoiceFile() 【可选】,SDK,APP,DivaEventSendVoiceDone,DivaSendDTMF(“分机号码”),DivaReportDTMF(TRUE),注*这里调用DivaSendVoice()然后等到收到DivaEventSendVoiceDo
5、ne之后才发送分机号,主要可以起到定时器的作用。因为交换机的不同可能会因为过快的发送分机号而转接失败。例如发送一个10秒的语音文件,则在10秒后才会发送分机号。同样可以用DivaStartCallTimer ()来实现同样的的功能。,DivaEventSendDTMFToneEnded,呼出流程(拨分机),DivaEventDTMFReceived,DivaSetCallTypeFax() 如果DTMF收到的是Y,DivaEventCallConected 再次收到此事件,DivaSendFax(),SDK,APP,DivaEventFaxPageSent,DivaEventFaxSent,D
6、ivaEventCallDisconnected,DivaCloseCall(),DivaDisconnect(),Diva Server SDK,一、声明Class CCallBOOL b_Used;char m_CallerID30;char m_DTMF30; DivaCallHandle m_hDivaCall; ;CCall* pCall4; void MyCallBack(DivaAppHandle App,DivaEvent Evt, PVOID Para1,PVOID Para2);,Diva Server SDK,DivaInitialize()DivaRegister(Ev
7、entCallBack,MyCallBack); DivaListen()/可选,初始化,Diva Server SDK,void MyCallBack(DivaAppHandle App,DivaEvent Evt, PVOID Para1,PVOID Para2) switch (Evet)case DivaEventIncomingCall: ProcessInComingCall(Para1,Para2);case DivaEventCallConnected: ProcessConnected(Para1,Para2);case DivaEventDTMFReceived: Proc
8、essDTMF(Para1,Para2);case DivaEventSendVoiceFileDone: ProcessSendVoiceDone(Para1,Para2);case DivaEventFaxPageSent: ProcessFaxPageSent(Para1,Para2);case DivaEventFaxSent: ProcessFaxSent(Para1,Para2);case DivaEventCallDisconnected: ProcecessDisconnect(Para1,Para2);default:break; ,Diva Server SDK,Void
9、ProcessInComingCall(PVOID Para1,PVOID Para2) for(i=0;im_hDivaCall=(DivaCallHandle) Para1;DivaCallInfo callInfo; callInfo.size=sizeof(DivaCallInfo);DivaGetcallInfo( ,Diva Server SDK,Void ProcessCallConnected(PVOID Para1,PVOID Para2) Int i=(int)Para1;DivaSendVoiceFile(pCalli-m_hDivaCall,”weclome.wav”)
10、; ,Void ProcessCallConnected(PVOID Para1,PVOID Para2) Int i=(int)Para1;DivaSendFax(pCalli-m_hDivaCall,”test.tif”); /DivaReceiveFax(pCalli-m_hDivaCall,”rev.tif”); ,Diva Server SDK,Void ProcessDTMF(PVOID Para1,PVOID Para2) Int i=(int)Para1;char c=(char) Para2;if(c=#”)DivaRecordVoiceFile(pCalli.m_hDiva
11、Call,”rec.wav”);else if (c=X)DivaSetCallTypeFax(pCalli-m_hDivaCall);elsepCalli-m_DTMF +=(char)Para2;/do something with received DTMFs ,Diva Server SDK,Void ProcessDisconnect(PVOID Para1,PVOID Para2) Int i=(int)Para1;DivaCloseCall(pCalli-m_hDivaCall); ,Eicon, Eicon Networks, Diva, Diva and Dialogic are trademarks or registered trademarks of Eicon Networks Corporation or its subsidiaries.,