Intel 05-2065-002 manual Handling Keyboard Input Events, Handling SRL Events, TSUsrEvent Structure

Page 40

Demo Details

5.5.2Handling Keyboard Input Events

There is an endless loop {while(0)} in the main( ) function in the Main.cpp file. In that loop, the application waits forever for a keyboard event by calling the waitForKey( ) function. The event must be handled immediately and event-specific information should be retrieved before the next call to waitForKey( ).

5.5.3Handling SRL Events

When the R4/Global Call event is received, the application performs the following:

1.Get METAEVENT by calling gc_GetMetaEvent( ).

2.Get channel ID through device handle to channel mapping.

3.Get device type through device handle to type mapping.

4.Route meta event to the module specified by device type.

5.5.4Handling Application Exit Events

Normal application exit events, such as pressing either q or Q, or Ctrl+C, don’t enter the SRL. The main( ) function calls PDLSetApplicationExitPath( ) before initialization. In Windows, this function enables the detection of CTRL_CLOSE_EVENT (closing the window).

5.5.5TSUsrEvent Structure

The TSUsrEvent structure is used by the demo modules to return event processing results to the event router. It has five fields:

Event

The name of a user defined event, such as USR_CONNECTED, etc.

Destination

The name of the module that this event is destined for. A destination can be IP, VOICE, or NONE.

lineDevice

The device handle in this module. It will be later used by the Event Router as an index to find its counterpart in the destination module.

xmitSlot

An integer normally to be filled with with a time slot

neighborDevice neighbor device handle

dialString

A char string normally to be filled with a DTMF dialing string.

The TSUserEvt structure is defined as follows:

40

IP Media Server (Global Call) Demo Guide — November 2003

Image 40
Contents IP Media Server Global Call Demo Guide For Windows Operating SystemsIP Media Server Global Call Demo Guide November Contents Contents Figures Tables Revision History Document No Publication Date Description of RevisionsRevision History How to Use This Publication About This PublicationPurpose Intended AudienceRelated Information About This PublicationDemo1 Description Demo Description Hardware Requirements System2 RequirementsSoftware Requirements System Requirements Editing Configuration Files Editing the IPMediaServer.cfg Configuration FilePreparing To Run the Demo File LocationSample Configuration File Compiling and Linking Preparing to Run the Demo Command Line Switches Running4 DemoStarting the Demo Demo OptionsUsing the Demo Keyboard CommandsUsing the Media Server Runtime Keyboard CommandsConfirm Message Saved StopRecMenu Demo Voice Menu Flowchart Stopping the Demo Running the Demo Demo5 Details Files Used by the DemoDemo Source Code Files Files Used by the IP Media Server Global Call DemoDemo Details PDL Files PDL Files Used by the IP Media Server Global Call DemoProgramming Model Module StructureEventRouter IP Media Server Global Call Demo ArchitectureInterfaces EventRouterClasses Application ClassesIP Module Classes GetNumOfDevicesOnBoard Board CIPTBoard InitCIPMBoard Init Device CIPDevice Init ConnectDisconnect GetXmitSlotModule CVoiceModule Init Voice Module ClassesBoard CVoiceBoard Init Device CVoiceDevice Init PlayOnPlayComplete RecordThreads Initialization Event Handling Event MechanismHandling Keyboard Input Events Handling SRL EventsHandling Application Exit Events TSUsrEvent StructureDemo Details Demo Details Glossary IP Media Server Global Call Demo Guide November IP Media Server Global Call Demo Guide November IP Media Server Global Call Demo Guide November Symbols IndexIP Media Server Global Call Demo Guide November