| CONTACT | DEVELOPER CENTER | PARTNERS | SITEMAP
GO
Useful Links
  • Search Helpweb
    
    

Dialogic Support Helpweb

Dialogic® Diva® SDK

Diva SDK Programming Samples

The Diva Server SDK contains a number of useful sample programs. Some of these can be used as test tools (to test various SDK and card functions), while others just offer "how to" knowledge for would-be developers. The following describes the C, C++, Visual Basic, VBScript and VB.Net samples bundled with the SDK.


C Samples

These are command-line examples for Win32 platform. They are simple programs that allow the SDK user to very easily see the program flow, and therefore how things are done using the SDK.

Calls used by nearly every application: DivaRegister; DivaUnregister; DivaInitialize; DivaTerminate; DivaDisconnect; DivaCloseCall. All incoming call applications use DivaListen in order to see incoming calls. DivaListen is not required for applications that make only outbound calls.


SimpleVoipGateway

Although main is named main.cpp, it is actually C rather than C++.

Areas covered: Each call represented by a unique structure; TDM; SoftIP; callback; console; device enumeration; telling TDM from SoftIP lines; CLI; DNIS; voice; inbound; outbound; call tromboning (LI); call progress; DTMF inbound; version checking; ; voice calls

Functions: DivaCheckDeviceCapabilities; DivaGetLineDeviceInfo; DivaGetVersionEx;; DivaGetNumLineDevices; DivaGetLineDeviceInfo;; DivaListen; DivaGetCallInfo; DivaConnectVoice; DivaAlert; DivaAnswerVoice; DivaReject;

Events: DivaEventIncomingCall; DivaEventCallConnected; DivaEventCallDisconnected; DivaEventCallProgress; DivaEventLIConnectCompleted; DivaEventLIDisconnected


AudioMonitor

Areas covered: console; callback; passive monitoring; version check; dialled digit capture; recording to stereo WAV file; recording disconnect easons; transcode; CLI; DNIS; ; voice calls

Functions: DivaCreateMonitor; DivaDestroyMonitor; DivaMonitorGetCallInfo; DivaMonitorRecordAudio; DivaMonitorStopAudio; DivaMonitorCloseCallHandle; DivaGetVersion

Events: DivaEventMonitorCallInitiated; DivaEventMonitorCallConnected; DivaEventMonitorCallDisconnected; DivaEventMonitorCallInfo; DivaEventMonitorFrameReceived; DivaEventMonitorRecordEnded; DivaEventMonitorStatus


AudioMonitorRxStream

Areas covered: console; callback; passive monitoring; version check; stream audio to memory; transcode; leased line; CLI; DNIS; ; voice calls

Functions: DivaCreateMonitor; DivaDestroyMonitor; DivaGetVersion; DivaMonitorGetCallInfo; DivaCreateCall; DivaSetCallProperties; DivaDial; DivaMonitorCloseCallHandle; DivaReceiveAudio

Events: DivaEventMonitorCallInitiated; DivaEventMonitorCallConnected; DivaEventMonitorCallDisconnected; DivaEventMonitorFrameReceived; DivaEventMonitorCallInfo; DivaEventMonitorRecordEnded;DivaEventMonitorStatus; DivaEventCallConnected;DivaEventDataAvailable; DivaReceiveAudio; DivaEventCallDisconnected


AudioMonitorSingleRecording

Areas covered: console; callback; passive monitoring; version check; write audio to two mono WAV files; CLI; DNIS; voice calls

Functions: DivaCreateMonitor; DivaDestroyMonitor, DivaMonitorGetCallInfo; DivaMonitorRecordAudio; DivaMonitorStopAudio; DivaMonitorCloseCallHandle

Events: DivaEventMonitorCallInitiated; DivaEventMonitorCallConnected; DivaEventMonitorCallDisconnected; DivaEventMonitorFrameReceived; DivaEventMonitorCallInfo; DivaEventMonitorRecordEnded;DivaEventMonitorStatus;


FaxInSimple

The sample shows how to answer an incoming call and to receive a fax. The received fax is stored in the file RxFax.Tif, and any existing file will be overwritten. For each page information is printed.

The sample application is started from the command line. To terminate the application press ENTER.

Areas covered: console; receive fax; callback; TIFF; fax session status.

Functions: DivaGetCallInfo; DivaReceiveFax; DivaAnswer; DivaGetVersion; DivaListen; Events: DivaEventIncomingCall; DivaEventCallConnected; DivaEventFaxPageReceived; DivaEventFaxReceived; DivaEventCallDisconnected


FaxOutSimple

Sample for an outgoing call and sending a fax document. The sample shows how to connect a single call, to send a fax and to disconnect. For every page a message is printed. The sample is started from the command prompt. The phone number to dial and the file to send must be specified as parameters.

Areas covered: console; send fax; callback;TIFF; fax session status

Functions: DivaConnect; DivaGetCallInfo; DivaSendFax; DivaGetVersion;

Events: DivaEventCallConnected; DivaEventFaxPageSent; DivaEventFaxSent:


MessageWaiting

Areas covered: MWI; console; callback;

Functions: DivaMWIActivate, DivaMWIDeactivate, DivaGetVersion

Events: DivaEventMWICompleted; DivaEventMWIIndicated;


ShowDeviceStatus

Areas covered: console; line device status

Functions: DivaGetLineDeviceStatus, DivaGetVersion, DivaGetNumLineDevices


ShowDeviceStatusEvents

Areas covered: console; callback; line device status

Functions: DivaGetLineDeviceStatus, DivaGetVersion, DivaGetNumLineDevices;

Events: DivaSetLineDeviceStatusEvents; DivaEventDeviceStatusChanged


VoiceInSimple

Sample for a simple answering machine processing one call. The sample shows how to answer a single call, to stream a message and to record a message. The sample is started from the command prompt. It answers any incoming call and streams an audio file and records the answer. The answer is limited to 20 seconds or 5 seconds of silence. The application is terminated by pressing any key.

Areas covered: Console; callback; incoming calls; voice; voice prompts; voice recording; WAV; VAD; silence detection; call properties

Functions: DivaListen; DivaGetVersion; DivaAnswer; DivaSendVoiceFile; DivaRecordVoiceFile; DivaSetCallProperties

Events: DivaEventIncomingCall; DivaEventCallConnected; DivaEventSendVoiceEnded; DivaEventRecordVoiceEnded; DivaEventCallDisconnected


VoiceOutSimple

Sample for an outgoing call including streaming a file. The sample shows how to connect a single call, to stream a message and to disconnect. The sample is started from the command prompt. The phone number to dial and the file to stream must be specified as parameters.

Areas covered: Console; callback; outgoing calls; voice; voice prompts; WAV

Functions: DivaGetVersion; DivaConnect; DivaSendVoiceFile

Events: DivaEventCallConnected; DivaEventSendVoiceEnded; DivaEventCallDisconnected


VoiceOnLeasedLine

Sample for an outgoing call on a leased line including streaming a file. The sample shows how to connect or answer a single call on a leased line, to stream a file in originator mode or to record a file in answer mode and to disconnect. The sample is started from the command prompt. The channel to use and the file to stream must be specified as parameters.

Areas covered: Console; callback; outgoing call; channel selection; line selection; B channel allocation; voice calls

Functions: DivaCreateCall, DivaSetCallProperties; DivaDial; DivaGetVersion; DivaRecordVoiceFile; DivaDisconnect

Events: DivaEventCallConnected; DivaEventSendVoiceEnded; DivaEventRecordVoiceEnded; DivaEventCallDisconnected:


X25SingleCall

Areas covered: Console; callback; X.25 on B channel; incoming call; outgoing call; data connection; sending data; receiving data; get call info

Functions: DivaSendData, DivaCreateCall; DivaSetCallProperties; DivaDial; DivaGetCallProperties; DivaReceiveData; DivaAnswer; DivaGetCallInfo;

Events: DivaEventDataSent; DivaEventIncomingCall; DivaEventCallConnected; DivaEventCallDisconnected; DivaEventDataAvailable


SMSServiceCenter

Areas covered: SMS-to-fixed; SMSC; console; callbacks; send/receive SMS; call progress; incoming call; outgoing call; version checking; device enumeration; disconnect reasons; custom tracing

Functions: DivaSms1SendMsgToL3; DivaGetCallInfo; DivaSms1GetLocalTime; DivaAttachToCall; DivaSms1NewCall; DivaSms1DeleteCall; DivaSms1ReleaseMsgReceived; DivaConnectSMS; DivaAnswerSMS; DivaReject; DivaGetVersionEx; DivaGetNumLineDevices; DivaSms1Stop; DivaSms1Start; DivaSetTraceFile; DivaEnableTrace

Events: DivaEventSmsError; DivaEventSms1MsgReceived; DivaEventCallDisconnected; DivaEventCallConnected; DivaEventCallProgress; DivaEventIncomingCall



C++ Samples

Calls used by nearly every application: DivaRegister; DivaUnregister; DivaInitialize; DivaTerminate; DivaDisconnect; DivaCloseCall. All incoming call apps use DivaListen in order to see incoming calls. DivaListen is not required for apps that make only outbound calls.


FaxMultiThreads

Areas covered: Windows Events; console; Multi-thread; one call per thread; TDM; Fax; Adding custom messages to Diva trace; device enumeration; Incoming calls; receive fax; command line; send fax; critical sections.

Functions: DivaGetNumLineDevices; DivaInitialize; DivaGetLineDeviceInfo; DivaRegister; DivaTerminate; DivaGetEvent; DivaReject; DivaCloseCall; DivaConnectFax; DivaAnswerFax; DivaReceiveFax; DivaSendFax; DivaDisconnect

Events: DivaEventIncomingCall; DivaEventCallDisconnected; DivaEventCallConnected; DivaEventCallProgress; DivaEventCallInfo; DivaEventFaxPageSent; DivaEventFaxSent; DivaEventFaxPageReceived; DivaEventFaxReceived


Conference (ConferenceSimple)

Connects incoming voice calls to the same conference. Automatic or manual connection or disconnection from the conference is possible. You can stream a WAV file to one or all members of the conference.

Areas covered: Windows GUI; conferencing; callbacks; device enumeration; multiple call handling; multiple calls per thread; incoming calls; conference recording; WAV; voice prompts; DNIS; CLI; DTMF handling; conference information; ; voice calls

Functions: DivaGetLineDeviceInfo; DivaGetNumLineDevices; DivaDestroyConference; DivaDisconnect; DivaCreateConference; DivaAddToConference; DivaRemoveFromConference; DivaRecordVoiceFile; DivaStopRecording; DivaSendVoiceFile; DivaGetCallInfo; DivaReportDTMF; DivaGetConferenceInfo; DivaAnswer

Events: DivaEventIncomingCall; DivaEventCallProgress; DivaEventCallInfo; DivaEventCallConnected; DivaEventCallDisconnected; DivaEventConferenceInfo; DivaEventSendVoiceEnded; DivaEventSendVoiceRestarted


ConferenceEx (ConferenceRights)

As above but with extra functionality:

Get/set conference rights (listen/speak/supervisor); conference participants;

Functions: DivaConferenceGetProperties; DivaConferenceSetProperties


Data

Makes or receives data connections. You can select different protocols (modem, digital 64k, V.120, V.110), and manually or automatically send data packets. You can also echo incoming data back to the sender.

Areas covered: Windows GUI; callbacks; device enumeration; async modem; send data; receive data; incoming call; outgoing call; V120; X75; HDLC/64K; GSM/V110; sync modem; SDLC; fast setup; V42; MNP; compression; reliable

Functions: DivaConnectModem; DivaConnect; DivaAnswer; DivaAnswerModem; DivaSendData; DivaGetCallInfo; DivaReceiveData; DivaGetNumLineDevices; DivaGetLineDeviceInfo; DivaDisconnect;

Events: DivaEventIncomingCall; DivaEventCallProgress; DivaEventCallConnected; DivaEventCallDisconnected; DivaEventDataAvailable; DivaEventDataSent


FaxIn (FaxExt)

Test program for receiving faxes. Supports TIF or SFF files, and also can be used to test fax-on-demand.

Areas covered: Windows GUI; Windows events; threads; device enumeration; send fax; receive fax; incoming calls; setting fax parameters; CLI; DNIS; TIFF; SFF; MR; MH; MMR; ECM; disconnect reasons; fax polling;

Functions: DivaGetNumLineDevices; DivaGetLineDeviceInfo; DivaSetLineDeviceParamsFax; DivaGetEvent; DivaAlert; DivaGetCallInfo; DivaAnswer; DivaReject; DivaReceiveFax; DivaSendFax;

Events: DivaEventIncomingCall; DivaEventCallInfo; DivaEventCallProgress; DivaEventCallConnected; DivaEventFaxReceived; DivaEventFaxSent; DivaEventFaxPageSent; DivaEventFaxPageReceived; DivaEventCallDisconnected


FaxOut

Test program for sending faxes. Fax files are picked up from a directory of your choice. The program the filenames and telephone numbers from a job file.

Areas covered: Windows GUI; Windows events; outgoing calls; threads; send fax; TIFF; SFF; disconnect reasons; device enumeration; receive fax; fax polling; call progress;

Functions: DivaConnectFax; DivaGetCallInfo; DivaSendFax; DivaReceiveFax; DivaGetEvent; DivaReject; DivaGetNumLineDevices; DivaGetLineDeviceInfo

Events: DivaEventIncomingCall; DivaEventCallInfo; DivaEventCallProgress; DivaEventCallConnected; DivaEventFaxReceived; DivaEventFaxSent; DivaEventFaxPageSent; DivaEventFaxPageReceived; DivaEventCallDisconnected;


LIConf

Line Interconnect example. Interconnects two incoming calls. You can then stream a WAV file to both calls, and you can also monitor the interconnected calls via the soundcard.

Areas covered: Windows GUI; callbacks; incoming calls; line interconnect; trombone; call transfer; bridged transfer; device enumeration; play audio to soundcard; active monitoring; voice calls

Functions: DivaGetNumLineDevices; DivaGetLineDeviceInfo; DivaAnswer; DivaGetCallInfo; DivaReceiveData; DivaLIEnableRxData; DivaSendVoiceFile

Events: DivaEventIncomingCall; DivaEventCallProgress; DivaEventCallConnected; DivaEventCallDisconnected; DivaEventDataAvailable; DivaEventLIConnectCompleted; DivaEventLIDisconnected; DivaEventSendVoiceDone


MS_Speech (MS_SAPI)

Areas covered: Windows GUI; DLL; Callbacks; SAPI; ASR; TTS; audio provider; audio streaming; threads; Microsoft speech; COM; incoming calls; voice calls

Functions: DivaRegisterAudioProvider; DivaReleaseAudioProvider; DivaConnect; DivaConnectAudioProvider; DivaDisconnectAudioProvider; DivaAnswer

Events: DivaEventIncomingCall; DivaEventCallDisconnected


VoiceExt1

Answering machine example. Picks up incoming calls, plays a message and records a message from the caller.

Areas covered: Windows GUI; Windows events; threads; voice calls; device enumeration; call recording; IVR; incoming calls; CLI; DNIS; voice prompts; DTMF; alaw; call progress; WAV

Functions: DivaGetNumLineDevices; DivaGetLineDeviceInfo; DivaSetLineDeviceParamsVoice; DivaAlert; DivaGetCallInfo; DivaAnswer; DivaSendVoiceFile; DivaReportDTMF; DivaGetEvent; DivaRecordVoiceFile;

Events: DivaEventIncomingCall; DivaEventCallInfo; DivaEventCallProgress; DivaEventCallConnected; DivaEventVoiceFileDone; DivaEventCallDisconnected; DivaEventDTMFReceived


VoiceExt2

PBX/Voicemail example. Picks up incoming calls, and then attempts to transfer the call (blind transfer) to an extension number dialed by the caller. If this fails, the caller is invited to leave a voicemail message.

Areas covered:Windows GUI; Windows events; threads; voice calls; device enumeration; call recording; IVR; incoming calls; DTMF; call transfer; blind transfer; CTI; call centre; PBX; auto attendant; barge-in; WAV

Functions: DivaAlert; DivaAnswer; DivaSendVoiceFile; DivaReportDTMF; DivaGetCallInfo; DivaBlindCallTransfer; DivaRecordVoiceFile; DivaStopSendingVoiceFile; DivaSendMultipleVoiceFiles; DivaGetEvent; DivaGetNumLineDevices; DivaGetLineDeviceInfo

Events: DivaEventIncomingCall; DivaEventCallInfo; DivaEventCallProgress; DivaEventCallConnected; DivaEventVoiceFileDone; DivaEventCallDisconnected; DivaEventDTMFReceived; DivaEventTransferCompleted; DivaSetLineDeviceParamsVoice



Visual Basic Samples

Incoming_Answering_Machine

Areas covered: GUI; events; voice; incoming calls; WAV; prompt play; voice recording; answer machine

Methods: Listen; Answer; SendVoiceFile; RecordVoiceFile; Disconnect;

Events: OnIncomingCall


Incoming_Fax

Areas covered: GUI; events; fax; incoming calls; receive fax; local fax id; fax status

Methods: Listen; Answer; ReceiveFax; Disconnect


Outgoing_Fax

GUI; fax; outgoing calls; send fax; TIFF;

Methods: Connect; SendFax; Disconnect; fax headline; local fax id


Outgoing_Voice_Event

Areas covered: GUI; events; asynchronous calls; voice; outgoing calls; WAV; prompt play; voice recording; answer machine

Methods: SendVoiceFile; StopSending; Connect; Disconnect

Events: OnConnected; OnDisconnected





VB Script samples

Incoming_Fax (FaxIn)

Areas covered: Script; incoming calls; fax; receive fax; TIFF; fax status

Methods: WaitForCall; ReceiveFax; Disconnect


Outgoing_Fax (FaxOut)

Areas covered: Script; outgoing calls; fax; local fax id; TIFF; fax status

Methods: Connect; SendFax; Disconnect


Incoming_Voice (Answer)

Areas covered: Script; incoming calls; voice; answer machine; voice prompt; record audio; WAV; DTMF

Methods: WaitForCall; SendVoiceFile; RecordVoiceFile; Disconnect

Outgoing_Voice (VoiceOut)

Areas covered: Script; outgoing calls; voice; voice prompt; WAV

Methods: Connect; SendVoiceFile; Disconnect





VB.NET 1.x Samples

ExchangePlainData

Areas covered: GUI; events; asynchronous calls; raw data; 64K; receive data; send data; outgoing calls;

Methods: Connect; Disconnect; ReceiveData; SendData

Events: OnConnected; OnDisconnected; OnDataAvailable;


IncomingMultipleCalls

Areas covered: GUI; events; voice calls; multiple calls; incoming calls; answer machine; voice prompts; voice recording; threads; one call per thread; call handler class; call centre; CTI

Methods: Answer; SendVoiceFile; RecordVoiceFile; Disconnect; Listen; CreateInstance; CreateCall

Events: OnIncomingCall


InterConnectCalls

Areas covered: GUI; events; threads; one call per thread; call handler class; call centre; CTI; IVR; call transfer; trombone;

Methods: Answer; Connect; Disconnect; CreateInstance; Listen; CreateCall; GetDevice; InterConnect; InterDisconnect

Events: OnIncomingCall





Feedback

Please rate the usefulness of this page:  

0 - not useful at all
1 - potentially useful
2 - quite useful
3 - very useful
4 - exactly the information I needed     

Please enter a comment about this page: