In the Dialogic HMP Program Part – I, I posted about installing and configuring HMP Software and testing it using freely available SoftPhone Software Kapanga. Once one completes that, one eliminates any doubt on the proper installation and configuration of the HMP software and safely start debugging his self written code.
Another important information is that, the code which is written for DNI boards using SS7 protocol ( for example SPCI4 and DNI240 board) using Global Call Protocol, would work as it is, except few steps like changing of the Device Name while opening it with gc_OpenEx() function. After changing these, the source code should work fine for VOIP calls!
Here are the few steps to code HMP :-
1. Start GC protocol using gc_Start() function.
2. Search for available VOIP Devices as well as Voice Resources. I normally enter them manually using a configuration files ( a TEXT file) as it is easier and help in various ways in future!
3. Open voice device using dx_open() function and store the voice handle.
4. Open VOIP Device using gc_OpenEx() function.
5. Add CODEC using gc_SetUserInfo() function;
6. Connect voice device and VoIP device using dx_Listen and gc_Listen() function.
7. Repeat #3 through #5 for all available devices;
8. Finally perform the final IVR call flow as well as other functionality.
The best way to find out working sample source code is to check basic gc_basic_call_model.c file which is found in Dialogic HMP directory demosgc_basic_call_model. The only problem with this code is, it does not play any WAV/VOX file, only receives call, make calls, disconnects call etc. But this sample code is very useful to learn IVR programming using any type of Dialogic CTI boards.
I will update this post with working sample source code soon!