180 likes | 349 Views
PIKA Technologies Inc. Analog Logger Application Sample December 2009. What is it?. Sample Application developed in C++ Can be used to passively record calls from Analog HMP Card Works on HMP 2.7 platforms (Windows, Linux) with PIKA Analog PCIe Boards (FXO) and Warp FXO module
E N D
PIKA Technologies Inc.Analog Logger Application Sample December 2009
What is it? Sample Application developed in C++ Can be used to passively record calls from Analog HMP Card Works on HMP 2.7 platforms (Windows, Linux) with PIKA Analog PCIe Boards (FXO) and Warp FXO module For Windows, a wav converter application is included to convert from raw to Wav format
Getting Started for the PC • Install the PIKA Low Level HMP API on a PC ( 2.7.x or newer ) as described in the Getting Started Guide • Install the PCIe board in the PC • Download, Compile, and run the Analog Logger application • Requires proper trunk licenses to be installed.
Getting Started with the Warp • Install PADS on a Linux PC as described in the PADS user’s Guide • Build PADS with the AnalogLogger extra package • Download the image and run the AnalogLogger application
Overall Architecture Description At start-up the application will create all the required instances. It will therefore create the System instance and its associated members. Each instance will communicate with the PIKA Driver (PKH_XXX) to configure and start it’s associated objects. For debugging purposes an event message logger (not to be confused with the analog logger) has been included to show events on the console and can also be injected to the PIKA Driver logs. The AnalogBoard instance contains a set of trunks that were detected.
Application thread Diagram PKH_SYSTEM_XXX Main Application Thread Initialize Analog Logger package PIKA Driver PKH_BOARD_XXX Configure PKH_TRUNK_XXX Start PKH_CHANNEL_XXX Stop PKH_RECORD_XXX PKH_LOG_XXX Cleanup PKH_FSK_XXX Spawn Thread Spawn Thread ApplicationEvent Thread PIKA Event Thread Application Queue WaitOnEvent PKH_QUEUE_XXX Raise event PIKA Event
Class Hierarchy and containment LogClient Logger (singleton) BaseEntity Filemanager (singleton) System 1 AnalogBoard 1 n Recorder 1 n Trunk 1 Fsk Rx 1 1 Dtmf Rx
Project Directory Description • Docs : Document description • Linux: Linux Makefile • Source: Source Code related to this application • Windows: All Windows related project and solution files.
Source Files Description • application.h: Defines all Application related definitions. • analogboard.cpp,.h : Analog Board class and method definition. Encapsulates Trunks instances. • analoglogger.cpp : Main Application methods • analogloggerconsole: Main Console application methods • baseentity.cpp,.h: Base Class for all PIKA related objects. • eventlistener.cpp, .h: Event Listener class and method definition used to propagate events to the application. • eventqueue.cpp, .h: Event Queue class and method definition used to propagate events to the application. • filemanager.cpp, .h: File Manager which hides OS-specific methods to save audio files. • logclient.cpp, .h: Log Client is a base class used to propagate message information events to the console and log files.
Source Files Description logger.cpp, .h: Log Client interfaces with the Logger Class singleton object to propagate message information events to the console and log files. receivedtmf.cpp, .h: Used to configure the trunk to handle dtmf callerID. receivefsk.cpp, .h: Used to configure the trunk to handle FSK callerID. recorder.cpp, .h: Used to record audio speech onto a binary file. system.cpp, .h: System class and method definition. Encapsulates Analog boards. trunk.cpp, .h: Trunk class and method definition. Encapsulates Recorder, Receive DTMF and Receive FSK instances. WaveConverter.cpp, .h: Functions used to convert from raw to .wav files (Windows only)
Developing and building with PC boards • Get the code onto the PC from either • Sample Code - HMP • svn link • For Windows with MS Visual Studio 2005 • Open /windows/AnalogLogger/AnalogLogger.sln • Build • For Linux run make • # cd linux • # make
Developing and building with Warp • Install PADS on a Linux PC • Build PADS • # make • Build Analog Logger application • # make analoglogger • Build image • # make image
Running the application • From the command line run the application • # ./analoglogger • For a list of parameters, add “-h” • # ./analoglogger –h • Creates 2 directories • inprogress : in progress audio recordings • complete : completed audio recordings
Customizing the application • Event Processing • Handle specific events or all PIKA related events • ProcessEvents for all PIKA related events • WaitOnEvent for Application specific events. • File name control • Refer to Recorder::openFile()
C# application • A C# application example exist in AnalogLogger.sln to demonstrate how one could interface with the analog logger as a DLL.
Reference Documentation • PIKA HMP – Getting Started • PIKA HMP - Programmer’s Guide • PIKA HMP – API Reference Manual • PADS User’s Guide
Comments and feedback • Add your feedback to the PIKA Forum.