Post on 12-Sep-2021
IPTMail_R4 Demo User�sGuide
for Windows
Copyright © 2002 Dialogic Corporation
05-1663-001
COPYRIGHT NOTICE
Copyright © 2002 Intel Corporation. All Rights Reserved.
Information in this document is provided in connection with Intel® products. No license, express orimplied, by estoppel or otherwise, to any intellectual property rights is granted by this document.Except as provided in Intel's Terms and Conditions of Sale for such products, Intel assumes noliability whatsoever, and Intel disclaims any express or implied warranty, relating to sale and/or use ofIntel® products including liability or warranties relating to fitness for a particular purpose,merchantability, or infringement of any patent, copyright or other intellectual property right. Intelproducts are not intended for use in medical, life saving, or life sustaining applications.
Intel may make changes to specifications and product descriptions at any time, without notice.
This document as well as the software described in it is furnished under license and may only be usedor copied in accordance with the terms of the license. The information in this manual is furnished forinformational use only, is subject to change without notice, and should not be construed as acommitment by Intel Corporation. Intel Corporation assumes no responsibility or liability for anyerrors or inaccuracies that may appear in this document or any software that may be provided inassociation with this document.
Except as permitted by such license, no part of this document may be reproduced, stored in a retrievalsystem, or transmitted in any form or by any means without express written consent of IntelCorporation.
Some names, products, and services mentioned herein are the trademarks or registered trademarks ofIntel Corporation or its subsidiaries in the United States and other countries. Other names and brandsmay be claimed as the property of others.
Publication Date: February, 2002
Part Number: 05-1663-001
Intel CorporationNetwork Processing Group1515 Route 10Parsippany NJ 07054U.S.A.
For Technical Support, visit the Dialogic support website at:http://support.dialogic.com
For Sales Offices and other contact information, visit the main Dialogic website at:http://www.dialogic.com
OPERATING SYSTEM SUPPORT
The term Windows refers to both the Windows NT® and Windows® 2000operating systems. For a complete list of supported Windows operating systems,refer to the Release Guide that came with your Dialogic System Release forWindows, or to the Dialogic support site at http://support.dialogic.com/releases.
v
Table of Contents1. About This Information .................................................................................. 11.1. Purpose ........................................................................................................... 11.2. Intended Audience .......................................................................................... 11.3. How to Use This Information ......................................................................... 11.4. Related Information ........................................................................................ 22. Demo Description............................................................................................. 32.1. Demo Features................................................................................................ 32.2. What Does the IPTMail_R4 Demo Do? ......................................................... 3
2.2.1. What the IPTMail_R4 Demo Does Not Do? ......................................... 32.3. How Does the IPTMail_R4 Demo Work?...................................................... 43. System Requirements ...................................................................................... 53.1. Hardware Requirements ................................................................................. 53.2. Software Requirements................................................................................... 54. The IPTMail_R4 Demo ................................................................................... 74.1. Preparing to Run the Demo ............................................................................ 7
4.1.1. Connecting to External Equipment ........................................................ 74.1.2. Downloading Firmware.......................................................................... 74.1.3. Edit the Iptmail_R4.cfg File................................................................... 8
4.2. Starting the Demo........................................................................................... 94.3. Demo Options................................................................................................. 94.4. Using the Demo ............................................................................................ 11
4.4.1. Using the Voicemail............................................................................. 114.5. Keyboard Commands ................................................................................... 124.7. Demo Details ................................................................................................ 12
4.7.1. Files Used by the Demo....................................................................... 134.7.2. Programming Model ............................................................................ 154.7.3. Demo-Related Initialization (Appinit.c)............................................... 164.7.4. IPLink-Related Initialization................................................................ 174.7.5. Voice-Related Initialization ................................................................. 184.7.6. Data Structures..................................................................................... 184.7.7. Event Mechanism ................................................................................ 22
5. Application Flow............................................................................................ 255.1. Using State Machines ................................................................................... 255.2. Inbound IP Call............................................................................................. 25
IPTMail_R4 Demo User�s Guide for Windows
vi
5.2.1. Null State ............................................................................................. 265.2.2. Offered State ........................................................................................ 275.2.3. Connected_Wait_Sig State .................................................................. 275.2.4. Disconnected State............................................................................... 285.2.5. Stop_Connection State......................................................................... 29
6. Using the Voice Mail ..................................................................................... 316.1. Recording a Message.................................................................................... 32
6.1.1. Connected_Rec_And_Send State......................................................... 336.1.2. Connected_Wait_Start_Rec State ........................................................ 336.1.3. Connected_Rec_Msg State .................................................................. 346.1.4. Connected_Stop_Rec State .................................................................. 346.1.5. Connected_Listen_My_Rec State ........................................................ 35
6.2. Listening to a Message ................................................................................. 366.2.1. Connected_Start_Listen State .............................................................. 376.2.2. Connected_Listen State........................................................................ 376.2.3. Connected_Stop_Listen State .............................................................. 37
6.3. Error Handling.............................................................................................. 386.3.1. IPTMAIL_QUIT State......................................................................... 396.3.2. Errors from IP ...................................................................................... 396.3.3. Errors from Voice Resources: .............................................................. 39
Index .................................................................................................................... 51
vii
List of TablesTable 1. IPTMail Command Line Switches........................................................... 9Table 2. IPTMail Source Files............................................................................. 13
IPTMail_R4 Demo User�s Guide for Windows
viii
ix
List of FiguresFigure 1. Connecting to External Equipment......................................................... 7Figure 2. Thread Diagram.................................................................................... 16Figure 3. State Diagram Inbound IP Call........................................................ 26Figure 4. Record Message State Diagram............................................................ 32Figure 5. Listen to Message State Diagram ......................................................... 36Figure 6. Error HandlingGCEV_DISCONNECTED ...................................... 38Figure 7. Error HandlingGCEV_TASKFAIL.................................................. 39
IPTMail_R4 Demo User�s Guide for Windows
x
1
1. About This Information
The following topics provide information about this guide:
• Purpose• Intended Audience• How to Use This Information• Related Information
1.1. Purpose
This guide provides information on the IPTMail_R4 demo that is available withthe IPLink software. This guide describes the demo, its requirements, and detailson how it works.
1.2. Intended Audience
This information is intended for:
• Distributors• Toolkit Developers• Independent Software Vendors (ISVs)• Value Added Resellers (VARs)• Original Equipment Manufacturers (OEMs)
1.3. How to Use This Information
The information in this guide is organized as follows:
• Demo Description introduces you to the demo and its features• Demo Requirements outlines the hardware and software required to run the
demo• IPTMail_R4 Demo describes the preparations required before running the
demo, how to run the demo, and details on how the demo works.
IPTMail_R4 Demo User�s Guide for Windows
2
1.4. Related Information
See the following for more information:• System Release 5.1.1 for Windows Release Update for information on
problems fixed, known problems and workarounds, compatibility issues andlast minute updates not documented in the published information.
• Dialogic FirstCall InfoServer support web site: http://support.dialogic.com.
3
2. Demo Description
The IPTMail_R4 demo illustrates how to build a simple Internet telephony voice-mail application using the R4/GlobalCall API.
NOTE: The IPTMail_R4 demo does not function as a gateway. Therefore, it cananswer calls only from the IP network. Gateway functionality can beadded by connecting a gateway to interface with the PSTN.
2.1. Demo Features
The IPTMail_R4 demo allows the user to:
• play pre-recorded announcements depending on system state• record new messages to a mailbox• listen to waiting messages
2.2. What Does the IPTMail_R4 Demo Do?
The IPTMail demo implements a simple Internet telephony voice-mailapplication. It receives a call from the IP network and re-routes the call to play aseries of voice menus. The demo recognizes the DTMF tones sent in response tothe menu prompts, and acts in accordance with the specific tone received.
2.2.1. What the IPTMail_R4 Demo Does Not Do?1. The demo does not allow setting the number of mailboxes on the fly. The
number of mailboxes that are supported by the application is defined in thefile maildefs.h (MAX_NUM_OF_MAILBOXS). The default is set to 200.Each mailbox can save only one message.
2. The following features are not supported by this demo application:
• UII message• NonStdCmd message• NonStdParm data• Q.931Facility message
IPTMail_R4 Demo User�s Guide for Windows
4
2.3. How Does the IPTMail_R4 Demo Work?
The application answers the incoming call from the IP. When the H.323connection has been established, the application uses the DM3 Player componentto play the voice-mail menu. The DM3 Signal Buffer sub-component is used torecognize the digits that were pressed by the user at the remote site. According tothe digit pressed, the application performs the appropriate operation:
• record new messages in a mailbox• listen to waiting messages
5
3. System RequirementsTo run the IPTMail_R4 demo, you must have a system that meets the followingrequirements.
3.1. Hardware Requirements
The following hardware is required:
• An Intel-based Pentium 200 MHz or better PC• At least 32 Mbytes of RAM• Additional 85 MB of available hard disk space• DM/IPLink-T1(E1)_NIC board
• The voice resource may be loaded on the IPLink board or on a D/xxboard, connected via an SCbus cable.
• CD-ROM drive• VGA or higher-resolution display adapter• Microsoft Mouse or compatible pointing device• IP network cable
Refer to the System Release 5.1.1 for Windows Release Guide for the most up-to-date information on board support for this demo.
3.2. Software Requirements
The following software is required:• Windows NT 4.0 with service pack 3 or Windows 2000• Visual C++ 6.0• Dialogic System Release 5.1.1 for Windows
IPTMail_R4 Demo User�s Guide for Windows
6
7
4. The IPTMail_R4 Demo
4.1. Preparing to Run the Demo
4.1.1. Connecting to External Equipment
This section describes how to connect the IPLink board to external equipment.
Connect a gateway to connect via the PSTN network, or use an Internet telephoneor NetMeeting to connect directly via the IP.
1 2 34 5 67 8 9
* 8 #
IP Phone
IPLink Board
Telephone
To NIC on IPLink Board
Gateway
To NIC on IPLink Board
Figure 1. Connecting to External Equipment
4.1.2. Downloading Firmware
This section describes how to download the IPTMail firmware. It specifies specialparameters that must be set before download.
IPTMail_R4 Demo User�s Guide for Windows
8
Follow the directions for installing and configuring IPLink in the System ReleaseInstallation and Configuration Guide for Windows . The following parametersshould be set in the Dialogic Configuration Manager (DCM) for the IPTMaildemo to work properly:
• PCD/FCD Files
Identify a PCD and corresponding FCD file that matches your configuration.Make sure to select a file that starts ipt_evr, in order to support the voiceresources needed for the voice mail application. The PCD files supplied withthe release are described in the System Release 5.1.1 for Windows ReleaseGuide.
• IP Address
1. Select the Network tab.
2. Enter the IP address of the NIC on the IPLink board in the IPAddressfield.
3. Enter the Gateway IP address in the Gateway IPAddress field. Thisaddress should match the segment in the IPAddress field, ending with250 (xxx.xxx.xxx.250).
4. Click on the Start Service button to start the download.
4.1.3. Edit the Iptmail_R4.cfg File
This section describes the configuration file used with the demo. It explains thecontents and presents a sample file.
Before running the demo, modify the IPTMai_R4l.cfg file to reflect your systemenvironment. Use a text editor and open the file fromDialogic\Samples\gc_demos\IPDemos\iptmail_R4\debug or \release.
Sample Configuration File
Below is an example of the IPTMail_R4.cfg file. Update the information about thecoder that should be used when originating a call toward the IP network,according to your configuration.
Channel = 1-30
4. The IPTMail_R4 Demo
9
{ipProtocolName = H323_NTSCCapability{
Type = g723_5_3kFramesPerPkt = 1VAD = 0
}}
4.2. Starting the Demo
This section describes how to start the demo, what must be done before launchingthe demo, and launch options.
Select Run from the Start Menu. The demo executable file can be found inC:\Program Files\Dialogic\Samples\gc_demos\IPDemos\Iptmail_R4\Debug\Iptmail_R4.exe. Click OK to run the IPTMail demo using the defaultsettings.
4.3. Demo Options
To specify certain options at run-time, launch the demo from a DOS commandline, using any of the switches listed in Table 1. IPTMail Command LineSwitches:
Table 1. IPTMail Command Line Switches
Switch Action Default
-n Sets the number ofchannels
The lesser of VoiceDevices or IP devices
-c <filename> Configuration file name IPTMail_R4.cfg
IPTMail_R4 Demo User�s Guide for Windows
10
Switch Action Default
-d Sets Debug Level:
0 = Fatal - used whenthere is a non-recoverable error
1 = Error - same as Fatal;used when there is a non-recoverable error
2 = Warning - used whensome problem or failurehas occurred, that doesn�taffect the channel�snormal action.
3 = Trace - used at thestart of any function, orupon the successfulcompletion of a function.
4 = Info - prints datarelated to a specificaction
0
4. The IPTMail_R4 Demo
11
Switch Action Default
-l Printouts will be printedinto channel log files inthe demo directory.
-lall = log files will becreated for all availablechannels
-l<channel list> = logfiles will be created onlyfor the channel ranges orchannels specified in thelist.
Note: If the �-l� option isnot used, all prints willbe to the stdout forchannels 1 and 2 only.
Disabled
-h or ? Prints the commandsyntax to the screen
Off
Each channel is initialized and the log for channels one and two is displayed in aDOS window. See Appendix A for the log file from one channel of a typicalsession receiving a call from the IP.
4.4. Using the Demo
4.4.1. Using the Voicemail
The IPTMail_R4 demo allows the caller to interact with a series of voice menus,using the telephone keypad to enter an option. Basic operations are play a pre-recorded message and record a new message. Each menu prompts the caller toselect an action by pushing a key.
Main Menu [Main_Menu]1 - Send Message
IPTMail_R4 Demo User�s Guide for Windows
12
2 - Listen to Message* - Quit
Send Message Prompt [Send_Message]Enter Mailbox Number - between 101 - 299* - Quit
Start Record Prompt [Start_Record]2 - Start/Stop Record (at end Stop Record Prompt is played)* - Quit
Stop Record Prompt [Stop_Record]2 - Discard Message and re-record message to same mailbox3 - Confirm Message (and Return to Main Menu) [Save_Confirm]4 - Replay Message (and replay Stop Record Prompt)* - Quit
Listen to Message Prompt [Listen_Menu]- Enter Mailbox Number - between 101 - 299 (Recorded message is played)* - Quit
Stop Listening Prompt [Stop_Listen]2 - Discard Message and quit (and Return to Main Menu)* - Quit
4.5. Keyboard Commands
While the demo is running, the administrator can send the following keyboardcommands to the demo:
• q , ctrl+c - end application• d - set debug level• c - print channel information
4.7. Demo Details
This chapter provides a detailed description of the demo.
4. The IPTMail_R4 Demo
13
4.7.1. Files Used by the Demo
This section presents a closer examination of the IPTMail_R4 demo, by lookinginto its structure and source code. The IPTMail_R4 demo source code is locatedin the Dialogic\Samples\gc_demos\IPDemos\iptmail_R4\ directory and isincluded in the following files:
Table 2. IPTMail Source Files
Samples\gc_demos\IPDemos\IPTMail_R4\
APPDEFS.H Application definitions
Samples\gc_demos\IPDemos\IPTMail_R4\
APPINIT.C Application initialization
Samples\gc_demos\IPDemos\IPTMail_R4\
APPINIT.H Header file for applicationinitialization
Samples\gc_demos\IPDemos\IPTMail_R4\
APPMAIN.C The main application file:contains the thread initialization,route ports, etc.
Samples\gc_demos\IPDemos\IPTMail_R4\
APPMAIN.H Header file for main application
Samples\gc_demos\IPDemos\IPTMail_R4\
APPPARS.C Read configuration file functions
Samples\gc_demos\IPDemos\IPTMail_R4\
APPPARS.H Header file for readingconfiguration file functions
Samples\gc_demos\IPDemos\IPTMail_R4\
APPSTAT.C Application state machinefunctions
Samples\gc_demos\IPDemos\IPTMail_R4\
APPSTAT.H Header file for the applicationstate machine functions
Samples\gc_demos\IPDemos\IPTMail_R4\
APPSTRC.H Definitions of applicationstructures
Samples\gc_demos\IPDemos\IPTMail_R4\
APPVARS.H Definition of applicationvariables
IPTMail_R4 Demo User�s Guide for Windows
14
Samples\gc_demos\IPDemos\IPTMail_R4\
GATEIP.C Initialize IP, Get IP availablechannels, handle IP events
Samples\gc_demos\IPDemos\IPTMail_R4\
GATEIP.H Header file for the IP functions
Samples\gc_demos\IPDemos\IPTMail_R4\
MAILDEFS.H Mailbox definitions
Samples\gc_demos\IPDemos\IPTMail_R4\
MAILUTIL.C Mailbox utility functions
Samples\gc_demos\IPDemos\IPTMail_R4\
MAILUTIL.H Header file for Mailbox utilityfunctions
Samples\gc_demos\IPDemos\IPTMail_R4\
VOICE.C Initialize voice resources, getvoice resources availablechannels, handle voice resourcesevents
Samples\gc_demos\IPDemos\IPTMail_R4\
VOICE.H Header file for voice resourcesfunctions.
Samples\gc_demos\IPDemos\IPTMail_R4\
Iptmail_r4.cfg IPTMail demo configuration file
Samples\gc_demos\IPDemos\IPTMail_R4\
Iptmail_r4.exe IPTMail demo executable file
Samples\gc_demos\IPDemos\IPTMail_R4\
Stoplisten.vox Voice file
Samples\gc_demos\IPDemos\IPTMail_R4\
ErrorInput.vox Voice file
Samples\gc_demos\IPDemos\IPTMail_R4\
ListenMenu.vox Voice file
Samples\gc_demos\IPDemos\IPTMail_R4\
MainMenu.vox Voice file
Samples\gc_demos\IPDemos\IPTMail_R4\
SaveConfirm.vox Voice file
4. The IPTMail_R4 Demo
15
Samples\gc_demos\IPDemos\IPTMail_R4\
SendMsg.vox Voice file
Samples\gc_demos\IPDemos\IPTMail_R4\
StartRec.vox Voice file
Samples\gc_demos\IPDemos\IPTMail_R4\
StopRec.vox Voice File
Samples\gc_demos\IPDemos\IPTMail_R4\
ThankYou.vox Voice File
Samples\gc_demos\IPDemos\IPTMail_R4\
UnavMenu.vox Voice File
Samples\gc_demos\UTIL\
Libdbg.c,Libdbg.h,Libdefs.h
Project files that include alldebug definitions and functions(static debug library)
NOTE: If you move the files for the IPTMail demo, be sure to move the .voxfiles as well, otherwise the IPTMail demo will not work.
4.7.2. Programming Model
The IPTMail_R4 demo is designed to operate in a single thread mode. (There is asecondary thread operating alongside the main thread. This secondary threadconsists of keyboard events, and does not change the overall structure of thedemo.). Because of the nature of a single threaded application, the state machinesdo not, and should not, block any other operation, but wait for the SRL.Figure 2. Thread Diagram illustrates the demo�s thread structure.
NOTE: The application programming framework also allows multi-threadoperation. It is not demonstrated in the IPTMail_R4 demo.
IPTMail_R4 Demo User�s Guide for Windows
16
sr_putevt
Keyboard
SRL
Thread 2
Thread 1
IPR4/GC
Figure 2. Thread Diagram
4.7.3. Demo-Related Initialization (Appinit.c)1. Get any arguments from the command-line.
2. Reset the demo data structures. Initialize all channels� states to INIT.
3. Call gc_Start(): starts all configured , call control libraries.
4. Set SRL modeltype to SR_STASYNC.
5. Set-up the call-back handler, callback_hdlr.
6. Call getVoiceChannels( ) which checks the number of available voicedevices :
• Get number of voice boards, by calling sr_getboardcnt( )
• For each board that was found:• Open the board, by calling dx_open()• Find number of channels per board, by calling ATDV_SUBDEVS()• Calculate the logical board and channel and save them into
Session.VoiceParams• Close the board, by calling dx_close( )
7. Call getIPChannels( ) which checks the number of available IP channels:
• Get number of voice boards, by calling sr_getboardcnt( )
4. The IPTMail_R4 Demo
17
• For each board that was found:• Open the board, by calling gc_open()• Find number of IP channels per board, by calling
TDV_SUBDEVS()• Calculate the logical board and channel and save them into
Session.IPParams• Close the board, by calling gc_close( )
8. Call getmailChannels( ) to find the demo MAX available channels (thesmaller of available IP or Voice Devices and the number of channelsspecified with the �n command line option, if used ).
NOTE: The printf() function must be used when printing an error/trace/warning during the above initialization operations one throughsix, because some actions are not related to a specific channel andlog files are not yet opened.
9. Open the channels� log files if �l command-line option was used.
10. Read information from the configuration file (IPTMail_R4.cfg or other CFGfile determined by the user) and update the ConfigFileParm in the Sessiondata structure.
11. Print information from the configuration file.
12. Call the IPInit() function. See Section 4.7.4. IPLink-Related Initializationfor a description of the IPInit() function.
13. Call the VoiceInit() function. See Section 4.7.5. Voice-Related Initializationfor a description of the VoiceInit() function..
14. Call the InitMailBoxs() function, which initializes the MailBox structure.
15. Create waitForKey thread to receive keyboard input.
4.7.4. IPLink-Related Initialization
The IPLink initialization procedure described in this section is defined in theIPInit() function in the GATEIP.C file, which performs the following:
For all channels:
• Call gc_OpenEx()
IPTMail_R4 Demo User�s Guide for Windows
18
Open all IP devices, and returns LineDevH.• Save the channel number in the global array (HandleToChannel[ ]) according
to the LineDevH handle.• Call gc_GetXmitSlot(VoiceH)
Gets the transmit timeslot(Xmitslot) for the IP devices and saves it in thesession.IPParams structure.
4.7.5. Voice-Related Initialization
Call VoiceInit(), located in the VOICE.C file, which does the following:
For all channels:
• Call dx_open() to get the VoiceH (voice device handle ).• Save the channel number in the global array (HandleToChannel[ ]) according
to the VoiceH handle.• Call dx_getxmitslot(VoiceH). Returns the Xmitslot (the SCbus time slot
connected to transmit of voice channel) and saves it in thesession.VoiceParams structure.
4.7.6. Data Structures
This section describes the main data structures:
• Session• IPParams• VoiceParams• MailBox
Session:
The Session data structure (defined in Appstrc.h) contains the following fields:
• SessionState• The state machine current state
• State machine function• The current state machine function according to SessionState
4. The IPTMail_R4 Demo
19
• Session Number• The channel number
• ConfigFileParm• Information from the CFG file
• LogFile• A pointer to a session log file
• lpMailBox• Pointer to the MailBox that is used
• ΙPparams• IPPARAMS structure
• VoiceParams• VOICEPARAMS structure
• enteredExtNum• the extension number entered by the user
There is a session structure for every channel. Each channel session containspointer to a MailBox structure.
typedef struct {
USHORT sessionState; /* Session state */appStateFxn stateFxn; /* Next state machine function to be called */UINT sessionNumber; /* Index session number */CallParameters ConfigFileParm; /* Information from cfg file */FILE *LogFile;LPMAILBOX lpMailBox; /* Pointer to the MailBox that is used */VOICEPARAMS VoiceParams; /* The voice device parameters */IPPARAMS ipParams; /* The IP device parameters */char enteredExtNum[10]; /* the Ext. number entered by the user*/BOOL IsRouted; /* If Route done then set flag to TRUE else FALSE */
} AppSession;
IPPARAMS
The IPParams data structure (defined in Appstrc.h) contains the following fields:
• LineDevH
IPTMail_R4 Demo User�s Guide for Windows
20
• The Line Device Handle, to identify the physical device(s) that carriesthe call
• VoiceDevH• The voice device handle
• Xmitslot• The timeslot number for the IP
• logBoard• The logical board number
• logChan• The logical channel number
• crn• The Call Reference Number, generated after getting IP Offered
typedef struct {LINEDEV linedev; /* line device handle to identify the IP physical */
/* device that carries the call */int VoiceDevH; /* the voice device handle */long XmitSlot; /* the transmit timeslot number assigned for the Voice */
/* Resourses */int logBoard; /* The logical board number for the session */int logChan; /* The logical channel number for the session */CRN crn; /* The current call's CRN */
} IPPARAMS;
VOICEPARAMS
The VoiceParams data structure (defined in Appstrc.h) contains the followingfields:
• VoiceDevH• The voice device handle
• Xmitslot• The timeslot number for the voice resources
• logBoard• The logical board number
4. The IPTMail_R4 Demo
21
• logChan• The logical channel number
• digp -• A structure(DV_DIGIT) for the digits when getting TDX_GETDIG
event
• iott• A structure (DX_IOTT) for the file handle, played or recorded file
• fPlayerStopped• A flag which indicates the Player status
• fRecorderStopped• A flag which indicates the Recorder status
typedef struct {int VoiceDevH; /* the voice device handle */long XmitSlot; /*the transmit timeslot number assigned for the Voice Resourses */int logBoard; /* The logical board number for the session */int logChan; /* The logical channel number for the session */DV_DIGIT digp[256]; /* A structure for the digits when getting TDX_GETDIG event */DX_IOTT iott; /* data structure contains parameters for the Input/Output */
/* Transfer Table. */BOOL fPlayerStopped; /* A flag which indicates the Player status */BOOL fRecorderStopped; /* A flag which indicates the Recorder status */
} VOICEPARAMS;
MailBox
The MailBox data structure (defined in Maildefs.h) contains the following fields
• ExtNum• an array that contains the digits of the mailbox number
• msgFileStatus• 0 = no message• 1 = one saved message
• isBusy• 1 = mailbox is currently answering a call• 0 = mailbox is ready to answer an incoming call
IPTMail_R4 Demo User�s Guide for Windows
22
typedef struct _MAILBOX {// mail-box numberchar ExtNum[MAX_EXTNUM_LENGTH+1];
// file status: 0 for no message,1 for saved messageMB_STATUS msgFileStatus;
// Mailbox busy: 0 for ready to answer an incoming call, 1 for currently answering acall
BOOL isBusy;
} MAILBOX, *LPMAILBOX;
4.7.7. Event Mechanism
The IPTMail_R4 demo uses the SRL mechanism to retrieve the IP/R4/Keyboardevents. The application waits for events using the sr_waitevt(-1) function. Whenan event occurs, SRL calls event handlers automatically.
In the initialization phase of the demo the mailInitialization() function willperform the following:
1. Set SRL modeltype to SR_STASYNC, by calling sr_setparm( ).2. Set-up the call-back handler, by calling sr_enbhdlr( ).
The SRL will be notified of application exit events using a special keyCTRL_CLOSE_EVENT, when calling sr_putevt().
Retrieving Events From the Queue
There is an endless loop {while(1) } in the main() function in the APPMAIN.Cfile. In that loop, the application waits forever for an event by calling thesr_waitevt( ) function. The event must be handled immediately and event-specificinformation should be retrieved before the next call to sr_waitevt().
When the next event occurs or when a timeout is reached, the sr_waitevt() returnsand the call-back handler function is called automatically.
Handling SRL Events
When the R4/GC/Keyboard event is received, the application performs thefollowing:
1. Get the event device handle, by calling sr_getevtdev().
4. The IPTMail_R4 Demo
23
2. Get the channel number related to the event, from the global array(HandleToChannel[ ]).
3. Update the METAEVENT structure by calling gc_GetMetaEvent().4. Get the event type, by calling sr_getevttype().
If type==CTRL_CLOSE_EVENT,then end application,else run the state machine function.
IPTMail_R4 Demo User�s Guide for Windows
24
25
5. Application Flow
5.1. Using State Machines
There is an endless loop (while(1)) in the main() function in the APPMAIN.C file.In that loop, the application waits for an event by calling the sr_waitevt()function.
All channels are initialized to the INIT state.
As soon as an event is received, the event type, the channel number, and thereason (reason for the event, if there is one) are analyzed, and the appropriate statemachine function is called.
After all the operations are performed within the channel's event state, the nextstate machine function is updated according to the event received and theSessionState.
5.2. Inbound IP Call
The following state diagram describes the call states for an inbound call from theIP to the demo. Each state is represented by an ellipse containing the state name,the event(s) associated with that state, and the actions performed by theapplication. The states are connected with arrows indicating the valid statechanges.
NOTE: Due to space restrictions, the state name in the diagram is presented inshortened format. Each state name should be prefixed by IPTMAIL_.
IPTMail_R4 Demo User�s Guide for Windows
26
INITInitializationIPTResetSession (TRUE)gc_start()IPInit()VoiceInit()
NULL
OFFERED
STOP_CONNECTION
DISCONNECTEDIP: GCEV_DISCONNECTED
if FPlayerStopped == FALSE, send dx_stopch(),Else,UnRoute, send gc_DropCall()
Voice: TDX_PLAY and TM_EOD
fPlayerStopped=TRUEUnRoute, send gc_DtopCall()
Voice: TDX_GETDIG
Send dx_clrdigbuf, dx_clrtpt, dx_play()fPlayerStopped = FALSEIf "*" was retrieved, play Thank_you
If "1" play the Send_Message menu If "2" play the Start_Listen menu
IP: GCEV_ANSWERED
RouteSend dx_clrdigbuf, dx_clrtpt, dx_play()fPlayerStopped = FALSEPlay Main Menu
IP: GCEV_EXTENSION
OnGCEventExtension()Send gc_ReleaseCall()IPTResetSession(FALSE)
IP: GCEV_UNBLOCKED
Send gc_WaitCall()
IP: GCEV_OFFERED
Fill gcParmBlk structure (coders)Send gc_SetUserInfo(), gc_AnswerCall()
CONNECTED_WAIT_SIG
IP: GCEV_DISCONNECTEDorIP: GCEV_TASKFAIL
Send gc_DropCall()
Voice: TDX_GETDIG
Send dx_clrdigbuf, dx_clrtpt, dx_play()fPlayerStopped = FALSE
Voice: TDX_Play and TM_EOD
Play Main Menu
Figure 3. State Diagram Inbound IP Call
5.2.1. Null State
The application waits for a call event in the IPTMAIL_ NULL state.
When the application receives the event GCEV_OFFERED, it calls an internalfunction ipAnswerCall() which fills the gcParmBlk structure with coder
5. Application Flow
27
information and sends gc_SetUserInfo() and gc_AnswerCall( ) to the firmware.The call state transitions to IPTMAIL_ OFFERED.
If, for any reason, the call should fail, the application receives aGCEV_TASKFAIL event. The application is ended and all channels are moved tothe IPTMAIL_QUIT state.
5.2.2. Offered State
When the application receives a GCEV_ANSWERED event, it routes the IP andVoice devices to listen to each other, flushes the DTMF buffer, enables the DTMFtones used by the Main menu, and plays the Main menu. The call state transitionsto IPTMAIL_ CONNECTED_WAIT_SIG.
If, for any reason, the function should fail, the application receives aGCEV_TASKFAIL event. It calls the internal function DisconnectCall which, inturn, stops the I/O operation if in process, calls gc_DropCall(), and unRoutes thecall, if needed. The call state transitions to IPTMAIL_ DISCONNECTED.
If, for any reason, the remote side should disconnect, the application receives aGCEV_DISCONNECTED event. It calls the internal function DisconnectCallwhich, in turn, stops the I/O operation if in process, calls gc_DropCall(), andunRoutes the call, if needed. The call state transitions to IPTMAIL_DISCONNECTED.
5.2.3. Connected_Wait_Sig State
The application waits for the user to make a selection from the Main menu:
• record a message (�1�)• listen to a message (�2�)• exit (�*�)
When the application receives a TDX_PLAY event, it determines if the Player wasstopped because it reached the end of data or a DTMF digit was detected. In thecase of end of data (TM_EOD), the Player replays the menu. In the case of a digit(TM_MAXDTMF), the application sends dx_getdig() to retrieve the digit.
IPTMail_R4 Demo User�s Guide for Windows
28
The application waits in the IPTMAIL_CONNECTED_WAIT_SIG_STATE untilit receives a TDX_GETDIG event.
If the retrieved digit is �1�, the application plays the Send_Message menu. Thecall state transitions to IPTMAIL_CONNECTED_REC_AND_SEND.
If the retrieved digit is �2�, the application plays the Start_Listen menu. The callstate transitions to IPTMAIL_CONNECTED_START_LISTEN.
If the retrieved digit is �*�, the application plays the Thank_You menu and thecall state transitions to IPTMAIL_STOP_CONNECTION.
If no digit was retrieved (due to timeout or a non-enabled digit), the applicationre-plays the Main menu.
The application can also receive a GCEV_DISCONNECTED event. It callsdx_stopch() to prevent further playing, unroutes the clusters, and callsgc_DropCall().
Once the call state transitions to IPTMAIL_CONNECTED_WAIT_SIG, thedemo application begins to operate in voice-mail mode. See Chapter 6. Using theVoice Mail for a complete description of this part of the demo.
5.2.4. Disconnected State
The application waits for a GCEV_DROPCALL event. When it receives thisevent, it sends the ExtensionGetCallInfo() function to get the call duration timeand RTCP information. This information is returned in the GCEV_EXTENSIONevent. When it receives this event, the application calls gc_ReleaseCall( ) andthen calls IPTResetSession(). The call state transitions to IPTMAIL_NULL andthe channel may be reused.
If the Player or Recorder haven�t yet been closed, the application waits for aTDX_PLAY or TDX_RECORD, closes the file and calls DisconnectCall() whichin turn calls gc_DropCall().
5. Application Flow
29
5.2.5. Stop_Connection State
The application waits for a TDX_PLAY event. It requests the termination reason,closes the played file, unroutes the devices and calls gc_DropCall(). The call statetransitions to IPTMAIL_DISCONNECTED.
The application may receive a GCEV_DISCONNECTED event. It checks to see ifthe Player has stopped. If PlayerStopped = FALSE, it sends dx_stopch() andwaits for TDX_PLAY and TM_EOD events. Upon receipt of these events, theapplication unroutes the clusters and calls gc_DropCall(). The call statetransitions to IPTMAIL_DISCONNECTED.
IPTMail_R4 Demo User�s Guide for Windows
30
31
6. Using the Voice Mail
Each state function within the voice mail part of the application performs the samebasic activities:
1. Wait for an IP and Voice Resource event.
2. Use dx_play() to play the appropriate menu. TDX_PLAY termination eventswill be generated to indicate completion.
After getting the TDX_PLAY event the application callsATDX_TERMMSK(chdev) to check the termination reason. It may eitherTM_EOD (end of data/file) or TM_MAXDTMF (user pressed digit/s asdetermined by the TPT � Termination Parameter Table).• If TM_EOD, then play the relevant menu again.• If TM_MAXDTMF, then collect the DTMF from the digit buffer.
3. Use dx_rec() to record a file. TDX_RECORD termination events will begenerated to indicate completion.
4. Call dx_getdig() to collect the DTMF tone(s) from the digit buffer.TDX_GETDIG termination event will be generated to indicate completion.
5. Call dx_clrdigbuf() to clear all digits in the channel�s firmware digit buffer.
6. Call dx_clrtpt() to clear the Table Parameter Termination (TPT) structure.
IPTMail_R4 Demo User�s Guide for Windows
32
6.1. Recording a Message
CONNECTED_REC_AND_SEND
CONNECTED_WAIT_SIG
CONNECTED_WAIT_START_REC
CONNECTED_REC_MSG
CONNECTED_STOP_REC
CONNECTED_LISTEN_MY_REC
STOP_CONNECTION
Voice: TDX_GETDIG
dx_clrdigbuf, dx_clrtpt, dx_playfPlayerStopped = FALSEAvailable mail box numberPlay Start_Record_Menu
Voice: TDX_GETDIG
dx_clrdigbuf, dx_clrtpt, dx_recfRecorderStopped = FALSEif "2" was retrievedRecord a Message
Voice: TDX_GETDIG
dx_clrdigbuf, dx_clrtpt, dx_playfPlayerStopped = FALSEif "4" was retrievedPlay recorded message
Voice: TDX_GETDIG
dx_clrdigbuf, dx_clrtpt, dx_playfPlayerStopped = FALSEif "1" was retrievedPlay Send_Message_Menu
Voice: TDX_PLAY
fPlayerStopped = TRUEdx_clrdigbuf, dx_clrtpt, dx_playfPlayerStopped = FALSEPlay Stop_Record_Menu
Voice: TDX_GETDIG
dx_clrdigbuf, dx_clrtpt, dx_recfRecorderStopped = FALSEif "2" was retrievedDiscard and Re-record Message
Voice: TDX_GETDIG
dx_clrdigbuf, dx_clrtpt, dx_play()fPlayerStopped = FALSE'*' was retrievedPlay Thank_You_Menu
Voice: TDX_RECORD
fRecorderStopped = TRUEdx_clrdigbuf, dx_clrtpt, dx_playfPlayerStopped = FALSEif "2" was retrievedPlay Stop_Record_Menu
Voice: TDX_GETDIG
dx_clrdigbuf, dx_clrtpt, dx_playfPlayerStopped = FALSEif "3" was retrievedPlay Save_Confirm_And_Main_Menu
Voice: TDX_GETDIG
if "*" was retrievedFree mailboxPlay Send_Message_Menu
Voice: TDX_GETDIG
if "*" retrievedPlay Main_Menu
Voice: TDX_GETDIG
if "*" retrievedDiscard Message andPlay Main_Menu
Figure 4. Record Message State Diagram
6. Using the Voice Mail
33
6.1.1. Connected_Rec_And_Send State
The application waits for a TDX_GETDIG event. The retrieved digit may beeither an asterisk �*� or a 3-digit mailbox number. Any other digit or combinationof digits generates an error.
If the digit is �*�, the application replays the Main menu and the call statetransitions to IPTMAIL_CONNECTED_WAIT_SIG.
If three digits are retrieved, the application checks if it is a legal mailbox number.If it is not, the application plays the ERROR_MENU and waits for anotherTDX_GETDIG event.
If the mailbox number is legal, the application checks if the requested mailbox isavailable. If it is unavailable, the application plays theUNAVAILABLE_TRY_AGAIN_MENU and waits for another TDX_GETDIGevent.
If the mailbox number is available, the application plays the STARTREC_MENUand the call state transitions to IPTMAIL_CONNECTED_WAIT_START_REC.
If the application receives a TDX_PLAY event, it requests the termination reason.If it receives TM_EOD, the STOPREC_MENU is played. Otherwise it callsdx_getdig() to collect the digit/s from the digit buffer,. The application then waitsfor a TDX_GETDIG event. The call state remains inIPTMAIL_CONNECTED_REC_AND_SEND.
6.1.2. Connected_Wait_Start_Rec State
The application waits for a TDX_GETDIG event. The retrieved digit may beeither an asterisk �*� or �2�. Any other digit generates an error.
If the digit is �*�, the application plays the SENDMSG_MENU. The call statetransitions to IPTMAIL_CONNECTED_RECORD_AND_SEND.
If the digit is �2�, the application:• Calls dx_clrtpt() to clear the TPT (Termination Parameter Table) structures• Sets the DV_TPT structure to terminate on "2"
IPTMail_R4 Demo User�s Guide for Windows
34
• Set up DX_IOTT (data structure that contains parameters for theInput/Output Transfer Table)
• Calls dx_clrdigbuf() to clear the digit from the buffer• Calls dx_rec() to begin recording on the channel
The call state transitions to IPTMAIL_CONNECTED_RECORD_MSG.
6.1.3. Connected_Rec_Msg State
The application waits for a TDX_RECORD event. It gets the termination reasonand calls dx_fileclose() to close the recorded file.
The application plays the STOPREC_MENU and the call state transitions toIPTMAIL_CONNECTED_STOP_REC.
6.1.4. Connected_Stop_Rec State
The application waits for a TDX_GETDIG event. The retrieved digit may beeither an asterisk �*�, �2�, �3�, or �4�. Any other digit generates an error.
If the returned digit is �2�, the application discards the recorded message andplays the beep prompt to begin recording again. The call state transitions toIPTMAIL_CONNECTED_RECORD_MSG.
If the returned digit is �3�, the application marks the mailbox as full and plays theSAVE_CONFIRM_AND_ MAIN_MENU. The call state transitions toIPTMAIL_CONNECTED_WAIT_SIG.
If the returned digit is �4�, the application plays the message back and the callstate transitions to IPTMAIL_CONNECTED_LISTEN_MY_REC.
If the returned digit it �*�, the application frees the mailbox and doesn�t store themessage. The application plays the MAIN_MENU and the call state transitions toIPTMAIL_CONNECTED_WAIT_SIG.
6. Using the Voice Mail
35
6.1.5. Connected_Listen_My_Rec State
The application waits for a TDX_PLAY event. When it receives the event, it closesthe played file, and plays the STOPREC_MENU. The call state transitions toIPTMAIL_CONNECTED_STOP_REC.
IPTMail_R4 Demo User�s Guide for Windows
36
6.2. Listening to a Message
CONNECTED_WAIT_SIG
CONNECTED_START_LISTENCONNECTED_STOP_LISTEN
CONNECTED_LISTEN
STOP_CONNECTION
Voice: TDX_GETDIG
dx_clrdigbuf, dx_clrtpt, dx_playfPlayerStopped = FALSEif "2" was retrievedPlay Listen_Menu
Voice : TDX_GETDIG
dx_clrdigbuf, dx_clrtpt, dx_play()fPlayerStopped = FALSE"*" was retrievedPlay Thank_You_Menu
Voice: TDX_GETDIG
dx_clrdigbuf, dx_clrtpt, dx_playfPlayerStopped = FALSEif "*" was retrievedPlay Main_Menu
Voice: TDX_GETDIG
dx_clrdigbuf, dx_clrtpt, dx_playfPlayerStopped = FALSE"*" was retrievedPlay Main_Menu
Voice: TDX_GETDIG
dx_clrdigbuf, dx_clrtpt, discard the file, dx_playfPlayerStopped = FALSEif "2" was retrievedDiscard saved message and play Main_Menu
Voice: TDX_GETDIG
dx_clrdigbuf, dx_clrtpt, dx_playfPlayerStopped = FALSEAvailable mail box numberPlay recorded message
Voice: TDX_PLAY
fPlayerStopped = TRUEdx_clrdigbuf, dx_clrtpt, dx_playfPlayerStopped = FALSEPlay Stop_Listen_Menu
Figure 5. Listen to Message State Diagram
6. Using the Voice Mail
37
6.2.1. Connected_Start_Listen State
The application waits for a TDX_GETDIG event. The retrieved digit may beeither an asterisk �*� or a 3-digit mailbox number. Any other digit or combinationof digits generates an error.
If the digit is �*�, the application replays the Main menu and the call statetransitions to IPTMAIL_CONNECTED_WAIT_SIG.
If three digits are retrieved, the application checks if it is a legal mailbox number.If it is not, the application plays the ERROR_MENU and waits for anotherTDX_GETDIG event.
If the mailbox number is legal, the application checks if the requested mailbox isavailable. If it is unavailable, the application plays theUNAVAILABLE_TRY_AGAIN_MENU and waits for another TDX_GETDIGevent.
If the mailbox number is available, the application plays the file and the call statetransitions to IPTMAIL_CONNECTED_LISTEN.
6.2.2. Connected_Listen State
The application waits for a TDX_PLAY event. When it receives the event, it getsthe termination reason, closes the played file, and plays theSTOPLISTEN_MENU. The call state transitions toIPTMAIL_CONNECTED_STOP_LISTEN.
6.2.3. Connected_Stop_Listen State
The application waits for a TDX_GETDIG event. The retrieved digit may beeither an asterisk �*� or �2�. Any other digit or combination of digits generates anerror.
If the digit is �*�, the application preserves the message in the mailbox and playsthe MAIN menu. The call state transitions toIPTMAIL_CONNECTED_WAIT_SIG.
IPTMail_R4 Demo User�s Guide for Windows
38
If the digit is �2� the application discards the message, frees the mailbox, andplays the MAIN menu. The call state transitions toIPTMAIL_CONNECTED_WAIT_SIG.
6.3. Error Handling
OFFERED
CONNECTED_WAIT_SIG
STOP_CONNECTION CONNECTED_LISTEN
CONNECTED_STOP_LISTEN
CONNECTED_REC_AND_SEND
CONNECTED_WAIT_START_REC
CONNECTED_STOP_REC
CONNECTED_LISTEN_MY_REC
CONNECTED_REC_MSG
CONNECTED_START_LISTEN
DISCONNECTED
Voice: TDX_ERROR
UnRoute()send gc_DropCall()
Voice: TDX_ERROR
UnRoute()send gc_DropCall()
Voice: TDX_ERROR
UnRoute()send gc_DropCall()
Voice: TDX_ERROR
UnRoute()send gc_DropCall()
Voice: TDX_ERROR
UnRoute()send gc_DropCall()
Voice: TDX_ERROR
UnRoute()send gc_DropCall()
Voice: TDX_ERROR
UnRoute()send gc_DropCall()
Voice: TDX_ERROR
UnRoute()send gc_DropCall()
Voice: TDX_ERROR
UnRoute()send gc_DropCall()
Voice: TDX_ERROR
UnRoute()send gc_DropCall()
Voice: TDX_ERROR
UnRoute()send gc_DropCall()
Figure 6. Error HandlingGCEV_DISCONNECTED
6. Using the Voice Mail
39
NULLINIT
QUIT
IP: GCEV_TASKFAIL
endApplication()
IP: GCEV_TASKFAIL
endApplication()
Figure 7. Error HandlingGCEV_TASKFAIL
6.3.1. IPTMAIL_QUIT State
The application waits for either a TDX_PLAY or a TDX_RECORD event.
Upon receiving either event, the application gets the termination reason, unroutesthe call, and closes the voice and IP devices. If all voice devices are closed, theapplication exits.
6.3.2. Errors from IP
The error might occur in different phases:
• If the called function returns a <0 , first process the error [by calling:gc_ErrorValue( ), gc_ResultMsg( ) ] and then end the call or exit the application.
• If the function was called successfully, but GCEV_TASKFAIL event isreceived later, indicating that the function failed, the application will beterminated
6.3.3. Errors from Voice Resources:
• The main error which could be received while calling the R4 function towardthe Voice Resources is represented by the TDX_ERROR event
• The IPTMail_R4 demo drops the call after receiving this error.
IPTMail_R4 Demo User�s Guide for Windows
40
41
Appendix ALog File02/13/02 10:01:29TRACE: File: gateip.c Line: 150
Got TX timeslot(47) of the IP device on channel1
02/13/02 10:01:29TRACE: File: voice.c Line: 200
Got TX timeslot(96) of the voice device on channel1
02/13/02 10:01:29TRACE: File: appstat.c Line: 62In IPTMAIL_INIT on channel 1
got Event GCEV_UNBLOCKED (0x833)
02/13/02 10:01:29TRACE: File: appstat.c Line: 81
gc_WaitCall was called on channel 1
02/13/02 10:01:32TRACE: File: appstat.c Line: 139In IPTMAIL_NULL on channel 1
got Event GCEV_OFFERED (0x824)
02/13/02 10:01:32TRACE: File: gateip.c Line: 311
Answering Call on channel 1
02/13/02 10:01:32TRACE: File: appstat.c Line: 216In IPTMAIL_OFFERED on channel 1
got event GCEV_ANSWERED (0x802)
02/13/02 10:01:32TRACE: File: appmain.c Line: 228
Voice device succeed to listen to IP device timeslot, on channel 1.
02/13/02 10:01:32TRACE: File: appmain.c Line: 238
IP device succeed to listen to Voice device timeslot, on channel 1.
02/13/02 10:01:32TRACE: File: appstat.c Line: 251
Route done on channel 1
02/13/02 10:01:32TRACE: File: voice.c Line: 288
The VOX file: mainmenu.vox was opened on channel 1
02/13/02 10:01:32TRACE: File: appstat.c Line: 261
Player started on channel 1
02/13/02 10:01:38TRACE: File: appstat.c Line: 313IPTMAIL_CONNECTED_WAIT_SIG on channel 1
got event TDX_PLAY (0x81)
IPTMail_R4 Demo User�s Guide for Windows
42
02/13/02 10:01:38TRACE: File: voice.c Line: 49
Player stopped on channel 1.Reason: Receiving DTMF digits
02/13/02 10:01:38TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:01:38TRACE: File: voice.c Line: 445
dx_getdig function sent successfully on channel 1
02/13/02 10:01:38TRACE: File: appstat.c Line: 313IPTMAIL_CONNECTED_WAIT_SIG on channel 1
got event TDX_GETDIG (0x83)
02/13/02 10:01:38TRACE: File: appstat.c Line: 334
Received digits: <1> on channel 1
02/13/02 10:01:38TRACE: File: voice.c Line: 288
The VOX file: sendmsg.vox was opened on channel 1
02/13/02 10:01:52TRACE: File: appstat.c Line: 491In IPMAIL_CONNECTED_RECORD_AND_SEND on channel 1
got event TDX_PLAY (0x81)
02/13/02 10:01:52TRACE: File: voice.c Line: 49
Player stopped on channel 1.Reason: End Of File
02/13/02 10:01:52TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:01:52TRACE: File: voice.c Line: 288
The VOX file: sendmsg.vox was opened on channel 1
02/13/02 10:02:03TRACE: File: appstat.c Line: 491In IPMAIL_CONNECTED_RECORD_AND_SEND on channel 1
got event TDX_PLAY (0x81)
02/13/02 10:02:03TRACE: File: voice.c Line: 49
Player stopped on channel 1.Reason: Receiving DTMF digits
02/13/02 10:02:03TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:02:03TRACE: File: voice.c Line: 445
dx_getdig function sent successfully on channel 1
Appendix A
43
02/13/02 10:02:05TRACE: File: appstat.c Line: 491In IPMAIL_CONNECTED_RECORD_AND_SEND on channel 1
got event TDX_GETDIG (0x83)
02/13/02 10:02:05TRACE: File: appstat.c Line: 511
Received digits: <121> on channel 1
02/13/02 10:02:05TRACE: File: appstat.c Line: 576
Available Mail_Box number on channel 1
02/13/02 10:02:05TRACE: File: voice.c Line: 288
The VOX file: startrec.vox was opened on channel 1
02/13/02 10:02:05TRACE: File: appstat.c Line: 587
Start Record Menu was played on channel 1
02/13/02 10:02:17TRACE: File: appstat.c Line: 685In IPTMAIL_CONNECTED_WAIT_START_REC on channel 1
got event TDX_PLAY (0x81)
02/13/02 10:02:17TRACE: File: voice.c Line: 49
Player stopped on channel 1.Reason: End Of File
02/13/02 10:02:17TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:02:17TRACE: File: voice.c Line: 288
The VOX file: startrec.vox was opened on channel 1
02/13/02 10:02:17TRACE: File: appstat.c Line: 685In IPTMAIL_CONNECTED_WAIT_START_REC on channel 1
got event TDX_PLAY (0x81)
02/13/02 10:02:17TRACE: File: voice.c Line: 49
Player stopped on channel 1.Reason: Receiving DTMF digits
02/13/02 10:02:17TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:02:17TRACE: File: voice.c Line: 445
dx_getdig function sent successfully on channel 1
02/13/02 10:02:17TRACE: File: appstat.c Line: 685In IPTMAIL_CONNECTED_WAIT_START_REC on channel 1
got event TDX_GETDIG (0x83)
IPTMail_R4 Demo User�s Guide for Windows
44
02/13/02 10:02:17TRACE: File: appstat.c Line: 706
Received digits: <2> on channel 1
02/13/02 10:02:17TRACE: File: voice.c Line: 355
The VOX file: MB121.vox was opened on channel 1
02/13/02 10:02:22TRACE: File: appstat.c Line: 850In IPTMAIL_CONNECTED_RECORD_MSG on channel 1
got event TDX_RECORD (0x82)
02/13/02 10:02:22TRACE: File: appstat.c Line: 866
Recorder stopped on channel 1.Reason: Specific digit received
02/13/02 10:02:22TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:02:22TRACE: File: voice.c Line: 288
The VOX file: stoprec.vox was opened on channel 1
02/13/02 10:02:37TRACE: File: appstat.c Line: 975In IPTMAIL_CONNECTED_STOP_REC on channel 1
got event TDX_PLAY (0x81)
02/13/02 10:02:37TRACE: File: voice.c Line: 49
Player stopped on channel 1.Reason: Receiving DTMF digits
02/13/02 10:02:37TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:02:37TRACE: File: voice.c Line: 445
dx_getdig function sent successfully on channel 1
02/13/02 10:02:37TRACE: File: appstat.c Line: 975In IPTMAIL_CONNECTED_STOP_REC on channel 1
got event TDX_GETDIG (0x83)
02/13/02 10:02:37TRACE: File: appstat.c Line: 994
Received digits: <4> on channel 1
02/13/02 10:02:37TRACE: File: voice.c Line: 288
The VOX file: MB121.vox was opened on channel 1
02/13/02 10:02:37TRACE: File: appstat.c Line: 1053
Play Recorded file on channel 1
Appendix A
45
02/13/02 10:02:41TRACE: File: appstat.c Line: 1184In IPTMAIL_CONNECTED_LISTEN_MY_REC on channel 1
got event TDX_PLAY (0x81)
02/13/02 10:02:41TRACE: File: appstat.c Line: 1200
Player stopped on channel 1.Reason: End Of File
02/13/02 10:02:41TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:02:41TRACE: File: voice.c Line: 288
The VOX file: stoprec.vox was opened on channel 1
02/13/02 10:02:41TRACE: File: appstat.c Line: 1214
Stop Record Menu was played on channel 1
02/13/02 10:02:53TRACE: File: appstat.c Line: 975In IPTMAIL_CONNECTED_STOP_REC on channel 1
got event TDX_PLAY (0x81)
02/13/02 10:02:53TRACE: File: voice.c Line: 49
Player stopped on channel 1.Reason: Receiving DTMF digits
02/13/02 10:02:53TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:02:53TRACE: File: voice.c Line: 445
dx_getdig function sent successfully on channel 1
02/13/02 10:02:53TRACE: File: appstat.c Line: 975In IPTMAIL_CONNECTED_STOP_REC on channel 1
got event TDX_GETDIG (0x83)
02/13/02 10:02:53TRACE: File: appstat.c Line: 994
Received digits: <3> on channel 1
02/13/02 10:02:53TRACE: File: voice.c Line: 288
The VOX file: saveconfirm.vox was opened on channel 1
02/13/02 10:02:53TRACE: File: appstat.c Line: 1037
Play Save_Confirm and MainMenu started on channel 1
02/13/02 10:03:05TRACE: File: appstat.c Line: 313IPTMAIL_CONNECTED_WAIT_SIG on channel 1
got event TDX_PLAY (0x81)
IPTMail_R4 Demo User�s Guide for Windows
46
02/13/02 10:03:05TRACE: File: voice.c Line: 49
Player stopped on channel 1.Reason: Receiving DTMF digits
02/13/02 10:03:05TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:03:05TRACE: File: voice.c Line: 445
dx_getdig function sent successfully on channel 1
02/13/02 10:03:05TRACE: File: appstat.c Line: 313IPTMAIL_CONNECTED_WAIT_SIG on channel 1
got event TDX_GETDIG (0x83)
02/13/02 10:03:05TRACE: File: appstat.c Line: 334
Received digits: <2> on channel 1
02/13/02 10:03:05TRACE: File: voice.c Line: 288
The VOX file: listenmenu.vox was opened on channel 1
02/13/02 10:03:17TRACE: File: appstat.c Line: 1305In IPMAIL_CONNECTED_START_LISTEN on channel 1
got event TDX_PLAY (0x81)
02/13/02 10:03:17TRACE: File: voice.c Line: 49
Player stopped on channel 1.Reason: Receiving DTMF digits
02/13/02 10:03:17TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:03:17TRACE: File: voice.c Line: 445
dx_getdig function sent successfully on channel 1
02/13/02 10:03:17TRACE: File: appstat.c Line: 1305In IPMAIL_CONNECTED_START_LISTEN on channel 1
got event TDX_GETDIG (0x83)
02/13/02 10:03:17TRACE: File: appstat.c Line: 1325
Received digits: <121> on channel 1
02/13/02 10:03:17TRACE: File: appstat.c Line: 1388
Available Mail_Box number on channel 1
02/13/02 10:03:17TRACE: File: voice.c Line: 288
The VOX file: MB121.vox was opened on channel 1
02/13/02 10:03:17
Appendix A
47
TRACE: File: appstat.c Line: 1401Play Recorded file on channel 1
02/13/02 10:03:21TRACE: File: appstat.c Line: 1495In IPTMAIL_CONNECTED_LISTEN on channel 1
got event TDX_PLAY (0x81)
02/13/02 10:03:21TRACE: File: appstat.c Line: 1511
Player stopped on channel 1.Reason: End Of File
02/13/02 10:03:21TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:03:21TRACE: File: voice.c Line: 288
The VOX file: stoplisten.vox was opened on channel 1
02/13/02 10:03:32TRACE: File: appstat.c Line: 1620In IPTMAIL_CONNECTED_STOP_LISTEN on channel 1
got event TDX_PLAY (0x81)
02/13/02 10:03:32TRACE: File: voice.c Line: 49
Player stopped on channel 1.Reason: End Of File
02/13/02 10:03:32TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:03:32TRACE: File: voice.c Line: 288
The VOX file: stoplisten.vox was opened on channel 1
02/13/02 10:03:33TRACE: File: appstat.c Line: 1620In IPTMAIL_CONNECTED_STOP_LISTEN on channel 1
got event TDX_PLAY (0x81)
02/13/02 10:03:33TRACE: File: voice.c Line: 49
Player stopped on channel 1.Reason: Receiving DTMF digits
02/13/02 10:03:33TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:03:33TRACE: File: voice.c Line: 445
dx_getdig function sent successfully on channel 1
02/13/02 10:03:33TRACE: File: appstat.c Line: 1620In IPTMAIL_CONNECTED_STOP_LISTEN on channel 1
got event TDX_GETDIG (0x83)
IPTMail_R4 Demo User�s Guide for Windows
48
02/13/02 10:03:33TRACE: File: appstat.c Line: 1639
Received digits: <*> on channel 1
02/13/02 10:03:33TRACE: File: voice.c Line: 288
The VOX file: mainmenu.vox was opened on channel 1
02/13/02 10:03:33TRACE: File: appstat.c Line: 1693
Main Menu was played on channel 1
02/13/02 10:03:38TRACE: File: appstat.c Line: 313IPTMAIL_CONNECTED_WAIT_SIG on channel 1
got event TDX_PLAY (0x81)
02/13/02 10:03:38TRACE: File: voice.c Line: 49
Player stopped on channel 1.Reason: Receiving DTMF digits
02/13/02 10:03:38TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:03:38TRACE: File: voice.c Line: 445
dx_getdig function sent successfully on channel 1
02/13/02 10:03:38TRACE: File: appstat.c Line: 313IPTMAIL_CONNECTED_WAIT_SIG on channel 1
got event TDX_GETDIG (0x83)
02/13/02 10:03:38TRACE: File: appstat.c Line: 334
Received digits: <*> on channel 1
02/13/02 10:03:38TRACE: File: voice.c Line: 288
The VOX file: thankyou.vox was opened on channel 1
02/13/02 10:03:43TRACE: File: appstat.c Line: 1796In IPTMAIL_STOP_CONNECTION on channel 1
got event TDX_PLAY (0x81)
02/13/02 10:03:43TRACE: File: appstat.c Line: 1812
Player stopped on channel 1.Reason: End Of File
02/13/02 10:03:43TRACE: File: voice.c Line: 508
File was closed on channel 1
02/13/02 10:03:43TRACE: File: appstat.c Line: 1819
Player was stopped, and disconnecting the call on channel 1.
02/13/02 10:03:43
Appendix A
49
TRACE: File: appmain.c Line: 417Making UnRoute on channel 1
02/13/02 10:03:43TRACE: File: appmain.c Line: 425
Dropping IP call on channel 1.
02/13/02 10:03:43TRACE: File: appstat.c Line: 1901In IPTMAIL_DISCONNECTED on channel 1
got event GCEV_DROPCALL (0x805)
02/13/02 10:03:43TRACE: File: gateip.c Line: 196
gc_Extension(RTCPINFO,CALLDURATION) function was called on cahnnel 1
02/13/02 10:03:43TRACE: File: appstat.c Line: 1901In IPTMAIL_DISCONNECTED on channel 1
got event GCEV_EXTENSION (0x868)
02/13/02 10:03:43INFO: File: gateip.c Line: 244
Got extension data RTCPINFO:timestamp 1092704,tx_packets 3653,tx_octets 73060send_indication 1
02/13/02 10:03:43INFO: File: gateip.c Line: 233
Got extension data CALLDURATION: 130
02/13/02 10:03:43TRACE: File: appstat.c Line: 1968
Releasing Call on channel 1.
02/13/02 10:03:46TRACE: File: appmain.c Line: 39
Voice Device was closed on channel 1.
02/13/02 10:03:46TRACE: File: appmain.c Line: 48
IP Line Device was closed on channel 1.
IPTMail_R4 Demo User�s Guide for Windows
50
51
Index
AAPPDEFS.H, 13
APPINIT.C, 13
APPINIT.H, 13
Application definitions, 13
Application initialization, 13
Application structures, 13
APPMAIN.C, 13, 22, 25
APPPARS.C, 13
APPSTAT.H, 13
APPSTATE.C, 13
APPSTRC.H, 13
APPVARS.H, 13
ATDV_SUBDEVS, 16
Ccall duration time, 28
Call statesIPTMail_Connected_Wait_Sig, 27IPTMail_Null, 25IPTMail_Stop_Connection, 28
Channel log files, 11
Coder, 8
Command syntax, 11
ConfigFileParm, 17
Confirm Message, 12
DDebug Level, 10
Discard Message, 12
DisconnectCall(), 27, 28
Downloading the IPTMail firmware, 7
DTMF, 3
DTMF buffer, 27
DTMF digit, 27
DV_TPT structure, 33
dx_close( ), 16
dx_clrdigbuf(), 31, 34
dx_clrtpt(), 33
dx_fileclose(), 34
dx_getdig(), 27, 31
dx_getxmitslot(), 18
DX_IOTT, 34
dx_open(), 16, 18
dx_play(), 31
dx_rec(), 31, 34
dx_stopch(), 28, 29
EEnd application, 12
end of data, 27
Enter Mailbox Number, 12
errMailBox.vox, 14
IPTMail_R4 Demo User�s Guide for Windows
52
ERROR_MENU, 33
ExtensionGetCallInfo(), 28
GGATEIP.C, 14, 17
Gateway functionality, 3
gc_AnswerCall, 27
gc_close( ), 17
gc_DropCall(), 27, 28
gc_ErrorValue(), 39
gc_GetXmitSlot(), 18
gc_open(), 17
gc_OpenEx(), 17
gc_ReleaseCall, 28
gc_ResultMsg( ), 39
gc_SetUserInfo(), 27
gc_Start(), 16
GCEV_ANSWERED, 27
GCEV_DISCONNECTED, 27
GCEV_DROPCALL, 28
GCEV_EXTENSION, 28
GCEV_OFFERED, 26
GCEV_TASKFAIL, 27
gcParmBlk structure, 26
HH.323, 4
Hardware configuration, 5
IInitialize IP, 14
Initialize voice resources, 14
InitMailBoxs(), 17
Input/Output Transfer Table, 34
ipAnswerCall(), 26
IPInit(), 17
IPTMail switches, 9
Iptmail.exe, 14
IPTMAIL_ DISCONNECTED, 27
IPTMAIL_ NULL, 26
IPTMAIL_ OFFERED, 27
IPTMAIL_CONNECTED_LISTEN_MY_REC, 34
IPTMAIL_CONNECTED_REC_AND_SEND, 28
IPTMAIL_CONNECTED_RECORD_AND_SEND, 33
IPTMAIL_CONNECTED_RECORD_MSG, 34
IPTMAIL_CONNECTED_STOP_LISTEN, 37
IPTMAIL_CONNECTED_STOP_REC,34, 35
IPTMAIL_CONNECTED_WAIT_SIG,27, 33, 34
IPTMAIL_CONNECTED_WAIT_SIG_STATE, 28
IPTMAIL_CONNECTED_WAIT_START_REC, 33
IPTMAIL_QUIT, 39
Index
53
IPTMail_R4.cfg, 8, 14, 17
IPTMAIL_STOP_CONNECTION, 28
IPTResetSession(), 28
KKeyboard commands, 12
LListen Menu, 12
Listen to a message, 27
Listen to Message Prompt, 12
ListenMenu.vox, 14
MMailbox definitions, 14
Mailbox number, 33
MailBox structure, 19
Mailbox utility functions, 14
maildefs.h, 3, 14
MAILUTIL.C, 14
MAILUTIL.H, 14
Main application file, 13
main(), 22, 25
MAIN.H, 13
Main_Menu, 11, 27, 34
MainMenu.vox, 14
MAX_NUM_OF_MAILBOXS, 3
NNetMeeting, 7
NonStdCmd message, 3
NonStdParm data, 3
PParameters, 7
PCD Files, 8
Player, 4
Print channel information, 12
printf(), 17
RRead configuration file functions, 13
Record a message, 27
Replay Message, 12
RTCP information, 28
SSaveConfirm.vox, 14
Send Message Prompt, 12
Send_Message Menu, 12, 28
SendMsg.vox, 15
Session data structure, 18, 19, 20
Session log, 11
Set debug level, 12
Setting the number of mailboxes, 3
Signal Buffer, 4
Software configuration, 5
Source code, 13
sr_enbhdlr( ), 22
sr_getboardcnt( ), 16
sr_getevttype(), 23
IPTMail_R4 Demo User�s Guide for Windows
54
sr_putevt(), 22
sr_setparm( ), 22
sr_waitevt( ), 22
SRL mechanism, 22
Start Record Prompt, 12
Start/Stop Record, 12
Start_Record Menu, 12
StartRec.vox, 15
STARTREC_MENU, 33
State machine functions, 13
stdout, 11
Stop Listening Prompt, 12
Stop Record Prompt, 12
Stop_Listen Menu, 12
Stop_Record Menu, 12
Stoplisten.vox, 14
StopRec.vox, 15
STOPREC_MENU, 33, 34, 35
TTDV_SUBDEVS(), 17
TDX_ERROR, 39
TDX_GETDIG, 28, 31, 37
TDX_PLAY, 27, 28, 35
TDX_RECORD, 28, 31, 34
Termination Parameter Table, 31
Termination reason, 33, 37
ThankYou.vox, 15
Thread initialization, 13
TM_MAXDTMF, 27
UUII message, 3
UNAVAILABLE_TRY_AGAIN_MENU, 33
UnavMenu.vox, 15
VVoice menus, 11
VOICE.C, 14
VOICE.H, 14
VoiceInit(), 17
WwaitForKey, 17