Dialogic IP Gateway (Global Call) Guide

Dialogic IP Gateway (Global Call) Guide

Below you will find brief information for IP Gateway Global Call. The Dialogic® IP Gateway (Global Call) demo is a host-based application that demonstrates using the Dialogic® Global Call API to build a PSTN-IP gateway. The demo source code can be used as sample code for those who choose to begin developing an application from a working application. The demo is not designed to implement a complete gateway and it lacks features such as least-cost routing, etc.

advertisement

Assistant Bot

Need help? Our chatbot has already read the manual and is ready to assist you. Feel free to ask any questions about the device, but providing details will make the conversation more productive.

Dialogic IP Gateway Global Call Demo Guide | Manualzz
Dialogic® IP Gateway (Global
Call)
Demo Guide
May 2008
05-2490-002
Copyright © 2003-2008 Dialogic Corporation. All rights reserved. You may not reproduce this document in whole or in part without permission in
writing from Dialogic Corporation.
All contents of this document are furnished for informational use only and are subject to change without notice and do not represent a commitment on
the part of Dialogic Corporation or its subsidiaries (“Dialogic”). Reasonable effort is made to ensure the accuracy of the information contained in the
document. However, Dialogic does not warrant the accuracy of this information and cannot accept responsibility for errors, inaccuracies or omissions
that may be contained in this document.
INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH DIALOGIC® PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY
ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN A
SIGNED AGREEMENT BETWEEN YOU AND DIALOGIC, DIALOGIC ASSUMES NO LIABILITY WHATSOEVER, AND DIALOGIC DISCLAIMS ANY
EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF DIALOGIC PRODUCTS INCLUDING LIABILITY OR WARRANTIES
RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY INTELLECTUAL PROPERTY
RIGHT OF A THIRD PARTY.
Dialogic products are not intended for use in medical, life saving, life sustaining, critical control or safety systems, or in nuclear facility applications.
It is possible that the use or implementation of any one of the concepts, applications, or ideas described in this document, in marketing collateral
produced by or on web pages maintained by Dialogic may infringe one or more patents or other intellectual property rights owned by third parties.
Dialogic does not provide any intellectual property licenses with the sale of Dialogic products other than a license to use such product in accordance
with intellectual property owned or validly licensed by Dialogic and no such licenses are provided except pursuant to a signed agreement with
Dialogic. More detailed information about such intellectual property is available from Dialogic’s legal department at 9800 Cavendish Blvd., 5th Floor,
Montreal, Quebec, Canada H4M 2V9. Dialogic encourages all users of its products to procure all necessary intellectual property licenses
required to implement any concepts or applications and does not condone or encourage any intellectual property infringement and
disclaims any responsibility related thereto. These intellectual property licenses may differ from country to country and it is the
responsibility of those who develop the concepts or applications to be aware of and comply with different national license requirements.
Dialogic, Dialogic Pro, Brooktrout, Cantata, SnowShore, Eicon, Eicon Networks, Eiconcard, Diva, SIPcontrol, Diva ISDN, TruFax, Realblocs,
Realcomm 100, NetAccess, Instant ISDN, TRXStream, Exnet, Exnet Connect, EXS, ExchangePlus VSE, Switchkit, N20, Powering The ServiceReady Network, Vantage, Connecting People to Information, Connecting to Growth, Making Innovation Thrive, and Shiva, among others as well as
related logos, are either registered trademarks or trademarks of Dialogic. Dialogic's trademarks may be used publicly only with permission from
Dialogic. Such permission may only be granted by Dialogic’s legal department at 9800 Cavendish Blvd., 5th Floor, Montreal, Quebec, Canada H4M
2V9. Any authorized use of Dialogic's trademarks will be subject to full respect of the trademark guidelines published by Dialogic from time to time and
any use of Dialogic’s trademarks requires proper acknowledgement. Developer Studio, Microsoft, Visual C++, and Windows are registered trademarks
of Microsoft Corporation in the United States and/or other countries. Other names of actual companies and products mentioned herein are the
trademarks of their respective owners.
Publication Date: May 2008
Document Number: 05-2490-002
Dialogic® IP Gateway (Global Call) Demo Guide – May 2008
Dialogic Corporation
Contents
Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
About This Publication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Applicability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Intended Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
How to Use This Publication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Related Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1
Demo Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2
System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.1
2.2
3
Preparing to Run the Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1
3.2
3.3
3.4
4
Connecting to External Equipment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing Configuration Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.1 File Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.2 Editing the gateway.cfg Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Compiling and Linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring the Dialogic® Host Media Processing Software. . . . . . . . . . . . . . . . . . . . . . .
3.4.1 Dialogic® HMP Software Licenses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.2 Country Dependent Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
15
16
16
19
20
20
20
Running the Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.1
4.2
4.3
4.4
5
Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Starting the Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Demo Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Stopping the Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
21
22
23
Demo Details. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.1
5.2
Files Used by the Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.1 Demo Source Code Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.2 Utility Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.3 PDL Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Programming Model Classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2.1 Class Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2.2 Channel Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2.3 Configuration Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2.4 GCCallControl Class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2.5 GCDevice Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2.6 GWCall Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2.7 IPBoard Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2.8 IPCallControl Class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2.9 IPDevice Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dialogic® IP Gateway (Global Call) Demo Guide – May 2008
Dialogic Corporation
25
25
27
27
28
29
29
30
31
31
32
32
32
33
3
Contents
5.3
5.4
5.5
6
Demo State Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.1
6.2
6.3
6.4
4
5.2.10 PSTNBoard Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.2.11 PSTNCallControl Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.2.12 PSTNDevice Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.2.13 ResourceManager Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.2.14 R4Board Class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.2.15 R4Device Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Threads. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Event Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.5.1 Event Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.5.2 Handling Keyboard Input Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.5.3 Handling Dialogic® SRL Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.5.4 Handling Application Exit Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
GWCall State Machine - Inbound Call from IP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.1.1 GWCall State Machine Description - Inbound from IP. . . . . . . . . . . . . . . . . . . . . . 41
6.1.2 GWCall::callNull State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
6.1.3 GWCall::callGetIPInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.1.4 GWCall::callIPOffered . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.1.5 GWCall::callIPAccepting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.1.6 GWCall::callPSTNConnected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.1.7 GWCall::callConnected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.1.8 GWCall::callDropping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.1.9 GWCall::callReleasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
GWCall State Machine - Inbound Call from PSTN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.2.1 GWCall State Machine Description - Inbound from PSTN . . . . . . . . . . . . . . . . . . 45
6.2.2 GWCall::callNull State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
6.2.3 GWCall::callPSTNDetected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.2.4 GWCall::callPSTNOffered . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.2.5 GWCall::callPSTNAccepting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.2.6 GWCall::callIPConnected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.2.7 GWCall::callConnected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.2.8 GWCall::callDropping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.2.9 GWCall::callReleasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
PSTNCallControl State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.3.1 PSTNCallControl State Machine Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.3.2 PSTNCallControl::Null State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.3.3 PSTNCallControl::Detected State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.3.4 PSTNCallControl::Offered State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.3.5 PSTNCallControl::Accepting State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.3.6 PSTNCallControl::Answering State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.3.7 PSTNCallControl::makingCall State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.3.8 PSTNCallControl::Connected State. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.3.9 PSTNCallControl::Dropping State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.3.10 PSTNCallControl::Releasing State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
IPCallControl State Machine. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.4.1 IPCallControl State Machine Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
6.4.2 IPCallControl::Null State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.4.3 IPCallControl::getCallInfo State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Dialogic® IP Gateway (Global Call) Demo Guide – May 2008
Dialogic Corporation
Contents
6.4.4
6.4.5
6.4.6
6.4.7
6.4.8
6.4.9
6.4.10
6.4.11
IPCallControl::offered State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPCallControl::accepting State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPCallControl::answering State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPCallControl::makingCall State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPCallControl::connected State. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPCallControl::dropping State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPCallControl::dropped State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPCallControl::releasing State. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
56
57
57
57
58
58
59
59
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Dialogic® IP Gateway (Global Call) Demo Guide – May 2008
Dialogic Corporation
5
Contents
Figures
1
2
3
4
5
6
7
8
9
6
Connecting to External Equipment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Configuration File Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Dialogic® IP Gateway (Global Call) Class Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Dialogic IP Gateway (Global Call) Demo Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Dialogic® IP Gateway (Global Call) System Initialization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
GWCall State Machine - Inbound Call from IP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
GWCall State Machine - Inbound Call from PSTN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
PSTNCallControl State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
IPCallControl State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Dialogic® IP Gateway (Global Call) Demo Guide – May 2008
Dialogic Corporation
Contents
Tables
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Command Line Switches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Runtime Keyboard Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Source Files Used by the Dialogic® IP Gateway (Global Call) Demo . . . . . . . . . . . . . . . . . . . .
Utility Files Used by the Dialogic® IP Gateway (Global Call) Demo . . . . . . . . . . . . . . . . . . . . .
PDL Files Used by the Dialogic® IP Gateway (Global Call) Demo - Windows® OS. . . . . . . . .
PDL Files Used by the Dialogic® IP Gateway (Global Call) Demo - Linux OS . . . . . . . . . . . . .
Channel Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuration Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GCCallControl Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GCDevice Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GWCall Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPMediaBoard Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPCallControl Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IPDevice Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PSTNCallControl Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PSTNDevice Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ResourceManager Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R4Board Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R4Device Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dialogic® IP Gateway (Global Call) Demo Guide – May 2008
Dialogic Corporation
22
23
25
27
27
28
30
30
31
31
32
32
33
33
33
34
34
35
36
7
Revision History
This revision history summarizes the changes made in each published version of this document.
Document No.
Publication Date
Description of Revisions
05-2490-002
May 2008
Made global changes to reflect Dialogic brand and changed title to “Dialogic® IP
Gateway (Global Call) Demo Guide.”
05-2490-001
December 2005
Initial version of document.
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
8
About This Publication
This section describes the purpose of the guide, the intended audience, and provides references to
other information that may be useful to the user.
• Purpose
• Applicability
• Intended Audience
• How to Use This Publication
• Related Information
Purpose
This guide provides information about the Dialogic® IP Gateway (Global Call) demo that is
available with your Dialogic® Host Media Processing (HMP) Software release. This guide
describes the demo, its requirements, and details about how it works.
Applicability
This document version (05-2490-002) is published for Dialogic® Host Media Processing Software
Release 3.0WIN and Dialogic® Host Media Processing Software Release 3.1LIN.
This document may also be applicable to later software releases (including service updates) on
Linux or Windows®. Check the Release Guide for your software release to determine whether this
document is supported.
Intended Audience
This guide is intended for application developers who choose to develope a PSTN-IP gateway
application using the Dialogic® Global Call API. Developers should be familiar with the C++
programming language and either the Windows® or Linux programming environments .
This information is intended for:
• Distributors
• Toolkit Developers
• Independent Software Vendors (ISVs)
• Value Added Resellers (VARs)
• Original Equipment Manufacturers (OEMs)
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
9
About This Publication
How to Use This Publication
Refer to this publication after you have installed the hardware and the Dialogic® HMP Software.
This publication assumes that you are familiar with the Windows® or Linux operating system and
the C++ programming language.
The information in this guide is organized as follows:
• Chapter 1, “Demo Description” introduces you to the demo and its features
• Chapter 2, “System Requirements” outlines the hardware and software required to run the
demo
• Chapter 3, “Preparing to Run the Demo” describes the preparations required before running
the demo
• Chapter 4, “Running the Demo” describes how to run the demo
• Chapter 5, “Demo Details” provides details on how the demo works
• Chapter 6, “Demo State Machines” provides details on the demo state machines
Related Information
See the following for additional information:
• http://www.dialogic.com/manuals/ (for Dialogic® product documentation)
• http://www.dialogic.com/support/ (for Dialogic technical support)
• http://www.dialogic.com/ (for Dialogic® product information)
10
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo Description
1.
1
The Dialogic® IP Gateway (Global Call) demo is a host-based application that demonstrates using
the Dialogic® Global Call API to build a PSTN-IP gateway. The demo source code can be used as
sample code for those who choose to begin developing an application from a working application.
The demo is not designed to implement a complete gateway and it lacks features such as least-cost
routing, etc.
The Dialogic IP Gateway (Global Call) demo supports the following features:
• Accepts IP calls
• Places IP calls
• Accepts PSTN calls
• Places PSTN calls
• Configuration file for hardware and parameter settings
• Command line options for running the demo executable file
• Output log files
• Printing and output tracing to the monitor
• QoS (Quality of Service)
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
11
Demo Description
12
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
System Requirements
2.
2
This chapter discusses the system requirements for running the Dialogic® IP Gateway (Global
Call) demo and contains the following topics:.
• Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
• Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.1
Hardware Requirements
To run the Dialogic IP Gateway (Global Call) demo, you need:
• Dialogic® Digital Network Interface board
• Network Interface Card (NIC)
• IP network cable
For other hardware requirements, such as memory requirements, see the Release Guide for the
system release you are using.
Network Hardware
The following network hardware components were tested for interoperability with the Dialogic IP
Gateway (Global Call) demo:
• Adtran TSU 600e multiplexer
• Polycom IP Soundpoint 300
2.2
Software Requirements
To run the Dialogic IP Gateway (Global Call) demo, you need the Dialogic® Host Media
Processing (HMP) Software and a valid Dialogic® HMP Software license.
Note:
A default, single port Validation license is enabled after the Dialogic® HMP Software is installed.
This default license supports the Dialogic IP Gateway (Global Call) demo.
For a list of operating system requirements, see the Release Guide for the system release you are
using.
See Section 3.3, “Compiling and Linking”, on page 19 for a list of compilers that may be used with
this demo. Using a non-supported compiler may cause problems in running the demo.
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
13
System Requirements
14
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
3
Preparing to Run the Demo
3.
This chapter discusses the preparations necessary to run the Dialogic® IP Gateway (Global Call)
demo and provides information about the following topics:
• Connecting to External Equipment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
• Editing Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
• Compiling and Linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
• Configuring the Dialogic® Host Media Processing Software. . . . . . . . . . . . . . . . . . . . 20
3.1
Connecting to External Equipment
The external equipment connections for the Dialogic IP Gateway (Global Call) demo are presented
in Figure 1:
Figure 1. Connecting to External Equipment
Host PC
(Dialogic® HMP Software)
PBX
Dialogic®
Network Interface board*
Analog Telephones
PSTN
SIP Phone*
IP network cable
1 2 3
IP Network
IP network cable
4 5 6
7 8 9
* 8
Network Interface Card
(NIC)
#
* Source IP address for the Dialogic® Network Interface board
and destination IP address for the SIP Phone are included in the gateway.cfg file.
3.2
Editing Configuration Files
This section discusses how to configure the demo for your system. It contains the following topics:
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
15
Preparing to Run the Demo
• File Location
• Editing the gateway.cfg Configuration File
3.2.1
File Location
Before running the Dialogic IP Gateway (Global Call) demo, modify the gateway.cfg file to reflect
your system environment. Use a text editor and open the file from the following subdirectory:
\demos\gateway\release.
3.2.2
Editing the gateway.cfg Configuration File
Below is an example of the gateway.cfg file. Update the following information according to your
development environment:
Source
Source (originator) address
Destination
IP address of the NIC on the destination Gateway host.
RemotePhoneNumber
Destination phone number to call. It is transferred during call establishment to target gateway.
LocalPhoneNumber
The number used for PSTN calls.
pstnProtocol
The PSTN protocol supported by the gateway. Possible values are: T1, E1, ISDN (including
NFAS), CAS.
Note: Certain PSTN protocols may require updates to the country dependent parameter
(CDP) files included in the Global Call Protocols package. Refer to the Dialogic®
Global Call Country Dependent Parameters (CDP) for PDK Protocols Configuration
Guide for more information.
DTMFmode
Specifies how DTMF tones are transmitted. Possible values are: RTPInBand (usually used
with G.711 coders), OutOfBand (usually used with low bandwidth coders, e.g., GSM),
RTPRFC2833.
ipProtocol
The IP Protocol used for opening the IP line devices. Values are: H323, SIP, both.
AudioRxCodecs
Describes the receive voice coder. The parameters are as follows:
• CoderType – The type of coder. See the Release Guide for specific information about
coder support in this release.
• CoderFramesPerPkt – Specify the number of frames per packet for the selected coder. See
the Release Guide for specific information about coder support in this release.
• CoderVAD – Specify if VAD is active. See the Release Guide for specific information
about coder support in this release.
AudioTxCodecs
Describes the transmit voice coder. See AudioRxCodecs for a description of the parameters.
16
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Preparing to Run the Demo
Data Codecs
Describes the fax coder parameters. See AudioRxCodecs for a description of the parameters.
Quality of Service
The application can set threshold values to monitor the quality of service during calls. A fault
occurs when the result of a measurement of a QoS parameter crossed a predefined threshold. A
success occurs when the result of a measurement of a QoS parameter did not cross a
predefined threshold. The QoS parameters are measured during time intervals, starting when a
call is established. The following parameters are supported:
• MediaAlarmLostPackets – indicates that the percentage of packets lost during a call
exceeded its threshold value
• MediaAlarmJitter – indicates that the jitter (as defined in RFC 1889) exceeded its
threshold value
QoS Attributes
Each parameter has six attributes:
• Threshold – defines when a QoS parameter is in a fault condition. A fault occurs when the
result of a measurement of a QoS parameter crossed the Threshold value.
• DebounceOn – the time during which faults are measured (in msec., must be multiple of
Interval)
• DebounceOff – the time during which successes are measured (in msec., must be multiple
of Interval)
• Interval – the amount of time between two QoS parameter measurements (in multiples of
100 msec)
• PercentFail – the threshold of failures during the DebounceOn time (expressed as a
percentage of failures)
• PercentSuccess – the threshold of successes during the DebounceOn time (expressed as a
percentage of successes)
The default values are as follows:
Interval
Percent_
Fail
Percent_
Success
Threshold
DebounceOn
DebounceOff
Lost packets
20
10000
10000
1000
60
40
Jitter
60
20000
60000
5000
60
40
Display
Display information passed to destination gateway during call establishment
IPT_UUI
User to User Information string. The information is sent before the Connected state.
UII
User Input Indication string to send. The maximum string length is 256 characters
(MAX_STRING).
NonStdParm
Non-standard parameter data to send
NonStdCmd
Non-standard command string to send. The maximum string length is 256 characters
(MAX_STRING).
ObjId
Object ID
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
17
Preparing to Run the Demo
Q931Facility
Facility data to send on the Q.931 channel. The maximum string length is 256 characters
(MAX_STRING).
Figure 2 illustrates how the configuration file parameters relate to the individual network
components.
Figure 2. Configuration File Parameters
PSTN/IP Gateway
(Destination)
Initiating PSTN Call
(LocalPhoneNumber)
Telephone
(RemotePhoneNumber)
IP Network
System running
demo
IP Client
(Destination)
PSTN/IP Gateway
(Source)
Sample Configuration File
Note:
The sample gateway.cfg file shown below coincides with the hardware setup shown in Figure 1,
“Connecting to External Equipment”, on page 15. The source and destination IP addresses for your
development environment will differ from those shown in the example below.
################################################################
# Copyright © 2005, Dialogic Corporation.
# All rights reserved All names, products, and services mentioned
# herein are the trademarks or registered trademarks of their respective
# organizations and are the sole property of their respective owners
###############################################################################
###############################################################################
# Source IP Address of the HMP System, of the format xxx.xxx.xxx.xx
# Destination - IP Address of the IP Endpoint, of the format xxx.xxx.xxx.xx
# ipProtocol - Type of Protocol to be used in the call, can be SIP or H323
# DTMFmode Type of digit transfer mode, can be inBand, rfc2833, outofband
###############################################################################
Channel = 1-120
{
Source = 196.112.106.139
Destination = 196.112.107.111
RemotePhoneNumber = 1
LocalPhoneNumber = 1
pstnProtocol = cas
DTMFmode = inBand
ipProtocol = SIP
18
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Preparing to Run the Demo
AudioRxCodecs
{
CoderType = g711mulaw
CoderFramesPerPkt = 30
CoderVAD = 0
}
AudioTxCodecs
{
CoderType = g711mulaw
CoderFramesPerPkt = 30
CoderVAD = 0
}
DataCodecs
{
CoderType = t38
}
MediaAlarmLostPackets
{
Threshold
=
DebounceOn
=
DebounceOff
=
Interval
=
PercentSuccess =
PercentFail
=
}
MediaAlarmJitter
{
Threshold
DebounceOn
DebounceOff
Interval
PercentSuccess
PercentFail
}
20
10000
10000
1000
60
40
=
=
=
=
=
=
#
#
#
#
#
#
Threshold
Threshold
Threshold
Threshold
Threshold
Threshold
60
20000
60000
5000
60
40
#
#
#
#
#
#
value
debounce ON
debounce OFF
Time Interval (ms)
Success Percent
Fail Percent
Threshold
Threshold
Threshold
Threshold
Threshold
Threshold
value
debounce ON
debounce OFF
Time Interval (ms)
Success Percent
Fail Percent
Display = GATEWAY_Chan1
IPT_UUI = User_to_User_1
UII = 12345
NonStdParm = NSP_Chan1
NonStdCmd = NSC_Chan1
ObjId = 2 16 840 1 113741
Q931Facility = facility 01
}
3.3
Compiling and Linking
Compile the project within the following environments:
• Windows®
– Microsoft® Visual C++® environment, version 6
• Linux
– g++
If you have added or changed files, put the files in the \demos\gateway subdirectory to compile the
project.
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
19
Preparing to Run the Demo
Set gateway_ood as the active project and build in debug or release mode.
Configuring the Dialogic® Host Media Processing
Software
3.4
This section discusses how to configure the Dialogic® Host Media Processing (HMP) Software,
and contains the following topics:
• Dialogic® HMP Software Licenses
• Country Dependent Parameters
Dialogic® HMP Software Licenses
3.4.1
A Dialogic® HMP Software license is a file containing authorizations for a combination of call
control and media processing channels. After you have installed the Dialogic® HMP Software on
the host PC, the Verification license is activated by default. This license is required to run the
Dialogic IP Gateway (Global Call) demo. Refer to the Dialogic® Host Media Processing Software
Installation Guide and Dialogic® Host Media Processing Software Administration Guide for more
information about Dialogic® HMP Software licenses.
3.4.2
Country Dependent Parameters
If you are using a PSTN trunk in your development environment that is configured to use Analog,
E1 CAS, or T1 robbed bit technologies, you will need to ensure protocol compatibility between the
PSTN trunk and the Dialogic® HMP Software . Protocol compatibility may require that you create
a pdk.cfg file and edit the appropriate country dependent parameter (*.cdp) file. Refer to the
Dialogic® Global Call Country Dependent Parameters (CDP) for PDK Protocols Configuration
Guide for more information.
Note:
20
pdk.cfg and *.cdp files do not apply to systems that use ISDN protocols.
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Running the Demo
4.
4
This chapter describes how to run the Dialogic® IP Gateway (Global Call) demo and contains the
following topics:
• Starting the Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
• Demo Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
• Using the Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
• Stopping the Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.1
Starting the Demo
Windows®
Select Run from the Start Menu. The demo executable file can be found in the following
subdirectory: \demos\gateway\release\gateway.exe. Click OK to run the Dialogic IP Gateway
(Global Call) demo using the default settings.
Linux
The demo executable file can be found in:
/usr/dialogic/demos/ipt/gc_demos/gateway_r4_ood/gateway_r4_ood.
4.2
Demo Options
To specify certain options at run-time, launch the demo from a command line, using any of the
switches listed in Table 1.
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
21
Running the Demo
Table 1. Command Line Switches
Switch
Action
Default
-c
<filename>
Configuration file name
-c gateway_r4.cfg
-d<n>
Sets Debug Level (0-4):
• 0-FATAL – used when one or more channels
are deadlocked.
• 1-ERROR – used when the application receives
a failure which doesn’t cause the channel to
be deadlocked.
• 2-WARNING – used when some problem or
failure occurred without affecting the
channel’s usual action.
• 3-TRACE – used at the start of the application
entrance or the start of any function.
• 4-INFO – prints data related to a specific action.
-d0 (Fatal)
Note: Debug level is inclusive; higher levels
include all lower levels
-h or ?
Prints the command syntax to the screen
Off
-l<n,…>
Printouts will be printed into channel log files.
Disabled
If ‘all’ follows the –l, log files will be created for all
available channels.
If a list of channels in the following format: C1-C2,
C3-C4, C5 follows the –l, log files are created for
the channel ranges or specific channels specified
in the list.
If the "–l" option is not used, prints go to the stdout,
for the first 2 channels only (to keep from
overloading the CPU, and more convenient for
viewing printouts).
4.3
-m<n,…>
Enables printing channel information to the
monitor, in addition to printing to the log file. A
maximum of 2 channels may be printed.
Disabled
-n<n>
Sets the number of gateway channels
The lesser of Voice
Devices or IP
devices
-q
Activates Quality of Service
Disabled
Using the Demo
The demo waits for input from the keyboard. While the demo is running, you may enter any of the
commands listed in Table 2:
22
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Running the Demo
Table 2. Runtime Keyboard Commands
Command
4.4
Function
c or C
Prints channel statistics to file (statistics.log)
d<n> or D<n>
Change debug level during runtime, where
<n> is the debug level
f or F followed by <channel number>
Send Q.931 facility message from the .cfg
file
m or M followed by <channel number>
Print log files for up to 2 channels to the
screen
n or N followed by <channel number>
Send H.245 non-standard command from
the .cfg file
q or Q or Ctrl+c
Terminates the application
u or U followed by <channel number>
Send H.245 User Input Indication message
from the .cfg file
Stopping the Demo
The Dialogic IP Gateway (Global Call) demo runs until it is terminated. Press “q” or “Q” or
“Ctrl+c” to terminate the demo application.
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
23
Running the Demo
24
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
5
Demo Details
5.
This chapter discusses the Dialogic® IP Gateway (Global Call) demo in more detail and contains
the following topics:
• Files Used by the Demo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
• Programming Model Classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
• Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
• Initialization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
• Event Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.1
Files Used by the Demo
This section lists the files used by the demo. It contains the following information:
• Demo Source Code Files
• Utility Files
• PDL Files
5.1.1
Demo Source Code Files
In Windows®, The source code files listed in Table 3 are located in:
\demos\gateway\release.
In Linux, the source code files listed in Table 3 are located in:
/usr/dialogic/demos/ipt/gc_demos/gateway_r4_ood/.
Table 3. Source Files Used by the Dialogic® IP Gateway (Global Call) Demo
Directory
File Name
Purpose
gateway_ood
channel.cpp
Implements the operations of the Channel class
gateway_ood
channel.h
Function prototype for channel.cpp
gateway_ood
configuration.cpp
Implements the operations of the Configuration class
gateway_ood
configuration.h
Function prototype for configuration.cpp
gateway_ood
defs.h
Global definitions
gateway_ood
gateway_r4_ood.ver
Demo version information
gateway_ood
gccallcontrol.cpp
Implements the operations of the GCCallControl class
gateway_ood
gccallcontrol.h
Function prototype for gccallcontrol.cpp
gateway_ood
gcdevice.cpp
Implements the operations of the GCDevice class
gateway_ood
gcdevice.h
Function prototype for gcdevice.cpp
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
25
Demo Details
Table 3. Source Files Used by the Dialogic® IP Gateway (Global Call) Demo (Continued)
Directory
26
File Name
Purpose
gateway_ood
gwcall.cpp
Implements the operations of the GWCall class
gateway_ood
gwcall.h
Function prototype for gwcall.cpp
gateway_ood
incfile.h
Function prototype for Global Call and R4 functions
gateway_ood
ipboard.cpp
Implements the operations of the IPBoard class
gateway_ood
ipboard.h
Function prototype for ipboard.cpp
gateway_ood
ipcallcontrol.cpp
Implements the operations of the IPCallControl class
gateway_ood
ipcallcontrol.h
Function prototype for ipcallcontrol.cpp
gateway_ood
ipdevice.cpp
Implements the operations of the IPDevice class
gateway_ood
ipdevice.h
Function prototype for ipdevice.cpp
gateway_ood
main.cpp
Contains the main function and the Wait for Key
gateway_ood
main.h
Function prototype for main.cpp
gateway_ood
pstnboard.cpp
Implements the operations of the DigitalPstnBoard class
gateway_ood
pstnboard.h
Function prototype for digitalpstnboard.cpp
gateway_ood
pstncallcontrol.cpp
Implements the operations of the PstnCallControl class
gateway_ood
pstncallcontrol.h
Function prototype for pstncallcontrol.cpp
gateway_ood
pstndevice.cpp
Implements the operations of the DigitalPstnDevice class
gateway_ood
pstndevice.h
Function prototype for digitalpstndevice.cpp
gateway_ood
r4board.cpp
Implements the operations of the R4Board class
gateway_ood
r4board.h
Function prototype for r4logicalboard.cpp
gateway_ood
r4device.cpp
Implements the operations of the R4Device class
gateway_ood
r4device.h
Function prototype for r4device.cpp
gateway_ood
resourcemanager.cpp
Implements the operations of the ResourceManager class
gateway_ood
resourcemanager.h
Function prototype for resourcemanager.cpp
gateway_ood
(Linux only)
gateway.cfg
Demo configuration file
gateway_ood
(Linux only)
makefile
Linux compilation file
gateway_ood
(Linux only)
gateway_ood
Linux executable
gateway_ood
(Windows® only)
gateway_ood.dsp
Microsoft® Visual C++® project file
gateway_ood
(Windows® only)
gateway_ood.dsw
Microsoft® Visual C++® project workspace
gateway_ood
(Windows® only)
gateway_ood.rc
Resource file
gateway_ood
(Windows® only)
resource.h
Microsoft® Developer Studio® generated include file used
by gateway_r4_ood.rc
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo Details
Table 3. Source Files Used by the Dialogic® IP Gateway (Global Call) Demo (Continued)
Directory
5.1.2
File Name
Purpose
gateway_ood/release
(Windows® only)
gateway.cfg
Demo configuration file
gateway_ood/release
(Windows® only)
gateway_ood.exe
Demo executable
Utility Files
In Windows®, the utility files listed in Table 4 are located in the following subdirectory:
\demos\shared\utilcpp.
In Linux, the utility files listed in Table 4 are located in:
/usr/dialogic/demos/ipt/gc_demos/utilcpp/.
Table 4. Utility Files Used by the Dialogic® IP Gateway (Global Call) Demo
Directory
File Name
Purpose
utilcpp
utilcpp.ver
Utility library version information
utilcpp
log.cpp
Debugging functions
utilcpp
log.h
Function prototype for libdbg.c
utilcpp
utilcpp.dsw
Utility library Microsoft® Visual C++® workspace
utilcpp.dsp
Utility library Microsoft® Visual C++® project file
utilcpp\release
(Windows® only)
utilcpp.lib
Compiled Utility library
/utilcpp (Linux only)
makefile.utilcpp
Compilation file
/utilcpp (Linux only)
libutilcpp.a
Compiled Utility library
(Windows® only)
utilcpp
(Windows® only)
5.1.3
PDL Files
In Windows®, the PDL files listed in Table 5 are located in the following subdirectory:
\demos\shared\pdl_win.
In Linux, the PDL files listed in Table 6 are located in:
/usr/dialogic/demos/ipt/gc_demos/utilcpp/pdl_linux/.
Table 5. PDL Files Used by the Dialogic® IP Gateway (Global Call) Demo - Windows® OS
Directory
File Name
Purpose
pdl_win
iptransport.cpp
PDL IP transport functions
pdl_win
iptransport.h
Function prototype for iptransport.cpp
pdl_win
pdl.c
Platform dependency functions
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
27
Demo Details
Table 5. PDL Files Used by the Dialogic® IP Gateway (Global Call) Demo - Windows® OS
Directory
File Name
Purpose
pdl_win
pdl.h
Function prototype for pdl.c
pdl_win
pdl.ver
PDL version information
pdl_win
pdl_win.dsp
PDL Visual C project file
pdl_win
pdl_win.dsw
PDL Visual C workspace
pdl_win\release
pdl_win.lib
Compiled PDL library
Table 6. PDL Files Used by the Dialogic® IP Gateway (Global Call) Demo - Linux OS
Directory
5.2
File Name
Purpose
pdl_linux
iptransport.cpp
PDL IP transport functions
pdl_linux
iptransport.h
Function prototype for iptransport.cpp
pdl_linux
libpdl.a
Compiled PDL library
pdl_linux
makefile.pdl
Compilation file
pdl_linux
pdl.c
Platform dependency functions
pdl_linux
pdl.h
Function prototype for pdl.c
pdl_linux
pdl.ver
PDL version information
Programming Model Classes
This section presents basic information about the Dialogic IP Gateway (Global Call) demo classes.
It contains the following information:
• Class Diagram
• Channel Class
• Configuration Class
• GCCallControl Class
• GCDevice Class
• GWCall Class
• IPBoard Class
• IPCallControl Class
• IPDevice Class
• PSTNBoard Class
• PSTNCallControl Class
• PSTNDevice Class
• ResourceManager Class
• R4Board Class
• R4Device Class
28
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo Details
5.2.1
Class Diagram
The following class diagram describes the relationship among the classes.
Figure 3. Dialogic® IP Gateway (Global Call) Class Diagram
&RQILJXUDWLRQ
5HVRXUFH0DQDJHU
,3%RDUG
3671%RDUG
,3'HYLFH
3671'HYLFH
5'HYLFH
&KDQQHO
,3&DOO&RQWURO
3671&DOO&RQWURO
5.2.2
*:&DOO
Channel Class
The Channel class controls the devices related to a call. It contains one IP device, one Public
Switched Telephone Network (PSTN) device and the calls related to these devices.
The Channel class attributes are described in Table 7.
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
29
Demo Details
Table 7. Channel Class Attributes
Name
5.2.3
Access
Privilege
Type
Description
m_pIPMediaDevice
private
IPDevice
The channel IP device
m_pPSTNDevice
private
IPSTNDevice
The channel PSTN device
m_channelInfo
private
ChannelInfo
Configuration information about the
channel
m_pLog
private
Log*
The channel log object
m_staticsInfo
private
ChannelStatistics
Channel statistical information
m_channelId
private
unsigned int
The channel identifier
m_GWCalls
private
GWCALL_LIST
List of the calls initiated on the
channel
Configuration Class
The Configuration class provides an interface to acquire the needed configuration data. It contains
the needed data structures to parse and save the system configuration (the configuration file and the
command line options) and reflects the system configuration to the other classes.
The Configuration class attributes are described in Table 8.
Table 8. Configuration Class Attributes
Name
30
Access
Privilege
Type
Description
m_userChannels
private
unsigned int
Indicates the number of channels that
the demo will work with.
m_chanInfo
private
ChannelInfoQueue
Queue that contains all the channel
information read from the
configuration file, such as Tx coder
information, the print to log file flag,
and the phone number to call.
m_boardInfo
private
BoardInfoQueue
Queue that contains all the board
information read from the
configuration file.
m_cfgFile
private
char
The configuration file name
m_alarmQoSFile
private
FILE
Points to the QoS file
m_QoSFile
private
char
The name of the QoS log file
m_logLevel
private
E_LogLevel
The log level from the command line
m_stage
private
unsigned char
The stage of parsing the configuration
file
m_line
private
int
The line in the configuration file
currently being parsed
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo Details
Table 8. Configuration Class Attributes (Continued)
Access
Privilege
Name
5.2.4
Type
Description
m_firstSession
private
long
Used to fill the channel information
from the configuration file
m_lastSession
private
long
Used to fill the channel information
from the configuration file
GCCallControl Class
The GCCallControl class provides the common functionality of GC call control devices. It is the
base class for the GC call control devices and contains the common attributes and operations.
The GCCallControl class attributes are described in Table 9.
Table 9. GCCallControl Class Attributes
Access
Privilege
Name
5.2.5
Type
Description
m_crn
protected
CRN
The call reference number of the
PSTN call control object
m_pLog
protected
Log
The log object used to control the CC
object printouts
m_stateFunctionArray
protected
StateFunction[MAX_S
TATE]
State machine function array
m_lineDevice
protected
LINEDEV
The line device of the device that the
call control belongs to
m_currentState
protected
E_StateMachine
The current state in the state machine
m_dnisEnabled
public
static bool
True if DNIS is used
GCDevice Class
The GCDevice class provides the common functionality of the R4 signaling devices. It is the base
class for R4 signaling devices.
The GCDevice inherits the R4Device Class attributes. The GCDevice class attributes are described
in Table 10.
Table 10. GCDevice Class Attributes
Name
Access
Privilege
Type
Description
m_pChannel
protected
Channel
Points to the channel containing this
device
m_txTimeSlot
protected
unsigned int
The transmit time slot of the device
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
31
Demo Details
5.2.6
GWCall Class
The GWCall class controls the resources related to a call. It contains the resources needed to
establish a call. The GWCall class reflects the intersection of call resource status.
The GWCall class attributes are described in Table 11.
Table 11. GWCall Class Attributes
Name
5.2.7
Access
Privilege
Type
Description
m_pPSTNCallControl
public
PSTNCallControl
PSTN call control object of the call,
handling the PSTN call control
m_pIPCallControl
public
IPCallControl
IP call control object of the call,
handling the IP call control
m_currentState
private
E_StateMachine
Current channel state
m_stateFunctionArray[M
AX_STATE]
private
int(stateFunction*)(co
nst long eventType,
METAEVENT*
eventData)
Array of state machine functions
m_pLog
public
Log
Log object of the call
IPBoard Class
The IPBoard class manages the IP device database. It contains the IP devices available in the
system and reflects the IP device repository.
The IPBoard inherits the R4Board Class attributes. The IPBoard class attributes are described in
Table 12.
Table 12. IPMediaBoard Class Attributes
Name
m_rasInfo
5.2.8
Access
Privilege
private
Type
RASInfo
Description
Includes the information for RAS, read
from the configuration file during
initialization
IPCallControl Class
The IPCallControl class provides the IP protocol functionality interface. It controls one IP call and
reflects the call status to the other classes.
The IPCallControl inherits the GCCallControl Class attributes. The IPCallControl attributes are
described in Table 13.
32
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo Details
Table 13. IPCallControl Class Attributes
Name
m_callInfo
5.2.9
Access
Privilege
private
Type
IPCallInfo
Description
Information connected to the IP call
IPDevice Class
The IPDevice class provides Global Call functionality for IP devices. It represents the IP devices
and reflects the device status and manages all calls related to it.
The IPDevice inherits the GCDevice class attributes. The IPDevice class attributes are described in
Table 14.
Table 14. IPDevice Class Attributes
Name
m_callControls
5.2.10
Access
Privilege
private
Type
IPCallControl{MAX_C
ALL_CONTROLS]
Description
Contains the call control objects
connected to this device
PSTNBoard Class
The PSTNBoard class provides the common functionality of all R4 PSTN boards. The PSTNBoard
class is the base class for the PSTN boards, containing the common attributes and operations.
The PSTNBoard inherits its attributes from the R4Board Class.
5.2.11
PSTNCallControl Class
The PSTNCallControl class provides a Global Call functionality interface to manage a call. It
reflects the PSTN call status to the other classes.
The PSTNCallControl inherits the GCCallControl Class attributes. The PSTNCallControl
attributes are described in Table 15.
Table 15. PSTNCallControl Class Attributes
Name
m_callInfo
Access
Privilege
private
Type
PSTNCallInfo
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Description
Contains information connected to the
PSTN call
33
Demo Details
5.2.12
PSTNDevice Class
The PSTNDevice class provides the common functionality of the R4 devices. It is the base class for
PSTN R4 devices.
The PSTNDevice inherits the GCDevice Class attributes. The PSTNDeviceclass attributes are
described in Table 16.
Table 16. PSTNDevice Class Attributes
Access
Privilege
Name
m_callControls
5.2.13
private
Type
PSTNCallControl[MA
X_CALL_CONTROLS
]
Description
Contains the call control objects
connected to this device
ResourceManager Class
The ResourceManager class initializes the R4 resources. It handles the R4 mechanism and reflects
the resource status. It contains the following data:
• all system channels
• configuration object for initialization
• maps R4 device handles to channels
• all detected R4 boards
The ResourceManager class attributes are described in Table 17.
Table 17. ResourceManager Class Attributes
Name
34
Access
Privilege
Type
Description
m_devicesQueue
private
R4DeviceQueue
[MAX_DEVICE_TYP
E]
Array of device pointer queues. The
array index is defined as board type
(IP, PSTN). It includes all the devices
in the system.
m_channelsQueue
private
ChannelQueue
A queue of all the channels created in
the system.
configuration
private
Configuration
An instance of the Configuration class
used to determine the configuration of
the system during initialization.
m_channelNum
private
int
The number of channels that the
demo will work with (this number is
the minimum of devices of each type
and the user requested
-n option).
m_printToMonitor
private
Int[MAX_PRINT_TO_
MONITOR]
The channels that are printing to the
monitor
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo Details
Table 17. ResourceManager Class Attributes (Continued)
Access
Privilege
Name
Type
Description
m_numOfPSTNBoards
private
int
The number of PSTN boards detected
in the system.
m_numOfIPBoards
private
int
The number of IP boards detected in
the system.
m_initLog
private
static Log
A log instance used during
initialization. All the printouts are sent
to the monitor, after which the
instance is destroyed.
This instance is necessary because
during the initialization, there are no
channel instances and therefore no
log instances. In order to see logs
during initialization, the application
creates a global log instance for all
the devices during initialization and
kills it after creating the channel
objects and attributing the devices to
channels.
5.2.14
R4Board Class
The R4Board class provides the common functionality for the R4 logical boards. It opens the
boards and obtains the information about the devices. The R4BoardClass is the base class for the
R4 logical boards containing the common attributes and operations. It represents any R4 logical
board.
The R4Board class attributes are described in Table 18.
Table 18. R4Board Class Attributes
Access
Privilege
Name
5.2.15
Type
Description
m_boardNumber
protected
int
The board number - used in setting
the device names found on the board
m_numOfDevices
protected
int
Number of devices available on the
board
R4Device Class
The R4Device class provides the common functionality for the R4 devices. It is the base class for
the R4 line devices that can be opened using gc_OpenEx( ). It contains the common attributes and
operations for the R4 devices.
The R4Device class attributes are described in Table 19.
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
35
Demo Details
Table 19. R4Device Class Attributes
Name
5.3
Access
Privilege
Type
Description
m_name
protected
char
The device name, e.g. ipmB1C1
m_inService
protecte
bool
True when the device is available
m_lineDevice
protected
LINEDEV
The device handle (valid after
opening)
m_pLog
protected
Log
The device log instance
Threads
The Dialogic IP Gateway (Global Call) demo operates with two threads, as shown in Figure 4.
Figure 4. Dialogic IP Gateway (Global Call) Demo Threads
.H\ERDUG
5*&
,3
65/
0DLQ7KUHDG
6XE7KUHDG
The threads are created as follows:
• The first (main) thread is created by the demo application to get the keyboard input.
• In Windows®, the second thread is a Dialogic® Standard Runtime Library (SRL) thread,
created as a result of the demo application calling sr_enblhdlr( ). In Linux, the second thread
must be explicitly created. All Global Call events are received through the Dialogic® SRL.
5.4
Initialization
This section describes the demo initialization as shown in Figure 5.
36
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo Details
Figure 5. Dialogic® IP Gateway (Global Call) System Initialization
$SSOLFDWLRQ
5HVRXUFH
0DQDJHU
&RQILJXUDWLRQ
,3
%RDUG
3671
%RDUG
&KDQQHO
,3
'HYLFH
3671
'HYLFH
LQLW
UHDG&RPPDQG/LQH
UHDG&RQILJXUDWLRQ
RSHQ
UHJLVWHU
VHW1XP2I&KDQQHOV
RSHQ
VHW1XP2I&KDQQHOV
ILQG0LQLPXP
JHW)UHH,3'HYLFH
JHW)UHH3671'HYLFH
LQLW'HYLFHV,3'HYLFH3671'HYLFH
RSHQ
RSHQ
The application main( ) function calls the init( ) function, which does the following:
1. Calls resourceManager.configure( ) to read the configuration file and command line options
and prints the configuration
2. Calls resourceManager.getChannelsNum( ) to get the number of channels defined by the
user in the configuration file or command line -n switch.
3. Calls gc_Start( ) to open all configured, call control libraries
4. Calls printAllLibs( ) to print library status (open or failed).
5. Sets-up the callback handler, PDLsr_enbhdlr( ). The callback handler handles events that it
receives from the Dialogic® SRL library. For more details see Section 5.5.3, “Handling
Dialogic® SRL Events”, on page 38.
6. Calls resourceManager.init( ) to get the resources available in the system:
a. Gets the number of IP channels in the system
b. Gets the number of PSTN channels in the system
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
37
Demo Details
c. Finds the minimum between the system channels and the user request
7. Looks for a free IP device and returns a pointer to it
8. Opens the IP device and if the open succeeds returns a pointer to it
9. Looks for a free PSTN device and returns a pointer to it
10. Opens the PSTN device and if the open success returns a pointer to it
11. Initializes the devices on the channel
12. The application main( ) function calls waitForKey( ), to receive keyboard input.
5.5
Event Handling
This section describes how the Dialogic IP Gateway (Global Call) demo handles events. It contains
the following topics:
• Event Mechanism
• Handling Keyboard Input Events
• Handling Dialogic® SRL Events
• Handling Application Exit Events
5.5.1
Event Mechanism
The Dialogic IP Gateway (Global Call) demo uses the Dialogic SRL mechanism to retrieve events.
When an event occurs, SRL calls event handlers automatically. All events are received by the SRL
and then passed to the callback_hdlr( ) function for handling.
In the initialization phase of the demo the init( ) function sets up the call-back handler, by calling
PDLsr_enbhdlr( ).
Refer to Chapter 6, “Demo State Machines” for more detailed event handling information.
5.5.2
Handling Keyboard Input Events
There is an endless loop {while(1)} 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( ).
When the next event occurs or when a time-out is reached, the waitForKey( ) returns and the callback handler function is called automatically.
5.5.3
Handling Dialogic® SRL Events
When the R4/Global Call event is received, the application performs the following:
1. Gets the event device handle, by calling PDLsr_getevtdev( )
38
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo Details
2. Gets the channel number related to the event, from the global array (HandleToChannel[ ])
3. Updates the METAEVENT structure by calling gc_GetMetaEvent( )
4. Gets the event type, by calling PDLsr_getevttype( )
5.5.4
Handling Application Exit Events
Normal application exit events don’t enter the Dialogic SRL. The main( ) function calls
PDLSetApplicationExitPath( ) before initialization. In Linux, this function sets the signals
(SIGINT, SIGTERM, SIGABRT) for making the appropriate exit from the application. In
Windows, this function enables the detection of CTRL_CLOSE_EVENT (closing the window).
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
39
Demo Details
40
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo State Machines
6.
6
This chapter discusses the Dialogic® IP Gateway (Global Call) demo state machines and contains
the following topics:
• GWCall State Machine - Inbound Call from IP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
• GWCall State Machine - Inbound Call from PSTN . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
• PSTNCallControl State Machine. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
• IPCallControl State Machine. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.1
GWCall State Machine - Inbound Call from IP
This section describes the state machine for an inbound call from the IP and contains the following
topics:
• GWCall State Machine Description - Inbound from IP
• GWCall::callNull State
• GWCall::callGetIPInfo
• GWCall::callIPOffered
• GWCall::callIPAccepting
• GWCall::callPSTNConnected
• GWCall::callConnected
• GWCall::callDropping
• GWCall::callReleasing
6.1.1
GWCall State Machine Description - Inbound from IP
All channels are initialized to the NULL state upon application start.
As soon as an event is received, the event type, the channel number, and the reason for the event (if
there is one), are analyzed and the appropriate state machine function is called.
After all the operations are performed within the channel's event state, the state machine function is
updated.
The following state diagram describes the call states for the GWCall class for an inbound call from
the IP.
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
41
Demo State Machines
Figure 6. GWCall State Machine - Inbound Call from IP
18//
*&(9B2))(5('IURP,3
6HQGHYHQWWR
,3&DOO&RQWUROZKLFKFDOOV
JFB([WHQVLRQ
*&(9B5(/($6(&$//
PBS,3&DOO&RQWURO!LV5HOHDVHG
PBS3671&DOO&RQWURO!LV5HOHDVHG
LIERWK758(XSGDWH6WDWH
*(7B,3B,1)2
*&(9B&$//352&
*&(9B$/$50
*&(9B(;7(16,21&03/7
PBS,3&DOO&RQWURO!JHW'HVW$GGU
PBS3671&DOO&RQWURO!SURFHVV(YHQW
865B0$.(&$//
URXWHWKHFDOO
*&(9B&$//352&
*&(9B352&((',1*
5(/($6,1*
*&(9B'523&$//
PBS,3&DOO&RQWURO!LV'URSSHG
PBS3671&DOO&RQWURO!LV'URSSHG
LIERWK758(XSGDWH6WDWH
XQURXWHWKHFDOO
,3B2))(5('
*&(9B$/(57,1*IURP3671
PBS,3&DOO&RQWURO!SURFHVV(YHQW
865B$&&(37
*&(9B$/$50
*&(9B(;7(16,21&03/7
*&(9B7$6.)$,/
'5233,1*
*&(9B&211(&7('IURP3671
PBS,3&DOO&RQWURO!SURFHVV(YHQW
865B$16:(5
*&(9B$&&(37
*&(9B',6&211(&7('
*&(9B7$6.)$,/
PBS3671&DOO&RQWURO!SURFHVV(YHQW
865B',6&211(&7LIIURP,3
RU
PBS,3&DOO&RQWURO!SURFHVV(YHQW
865B',6&211(&7LIIURP3671
,3B$&&(37,1*
*&(9B&211(&7('IURP3671
PBS,3&DOO&RQWURO!SURFHVV(YHQW
865B$16:(5
3671B&211(&7('
6.1.2
*&(9B$/$50
*&(9B$16:(5('
IURP,3
&211(&7('
865B6(1'B8,,
865B6(1'B)$&,/,7<
865B6(1'B16B&200$1'
PBS,3&DOO&RQWURO!SURFHVV(YHQW
GWCall::callNull State
The application waits in the gateNull state for a GCEV_OFFERED event from the IP. Upon receipt
of the event it transfers the event to the IPCallControl module which calls getIncomingCallInfo( ),
42
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo State Machines
which in turn calls gc_Extension( ). See Section 6.4.2, “IPCallControl::Null State”, on page 55 for
additional information. The call state transitions to callGetIPInfo.
If the application receives a GCEV_DISCONNECTED event, it sets the drop reason by calling
getResultValue( ) from the GCCallControl module. The application then calls
processEvent(USR_DISCONNECT) from the IPCallControl module if the PSTN was the event
source, or from the PSTNCallControl module if the IP was the event source. The call state
transitions to callDropping.
6.1.3
GWCall::callGetIPInfo
The application waits for a GCEV_EXTENSIONCMPLT event. Upon receipt of the event, it calls
getDestAddr( ) from the IPCallControl module and calls processEvent(USR_MAKECALL)
from the PSTNCallControl module. See Section 6.3, “PSTNCallControl State Machine”, on
page 49 for a description of the PSTNCallControl state machine. The application then routes the
call. The state transitions to callIPOffered.
If the application receives a GCEV_CALLPROC event, it ignores the event and remains in the
callGetIPInfo state.
6.1.4
GWCall::callIPOffered
The application waits for either a GCEV_ALERTING or a GCEV_CONNECTED event from the
PSTN.
In the case of GCEV_ALERTING, the application calls processEvent(USR_ACCEPT) from the
IPCallControl module and the call state transitions to callIPAccepting.
In the case of GCEV_CONNECTED, the application calls processEvent(USR_ANSWER) from
the IPCallControl module and the call state transitions to callPSTNConnected.
If the application receives a GCEV_CALLPROC or a GCEV_PROCEEDING event, it ignores the
event and remains in the callGetIPOffered state.
If the application receives a GCEV_DISCONNECTED or a GCEV_TASKFAIL event, it sets the
drop reason by calling getResultValue( ) from the GCCallControl module. The application then
calls processEvent(USR_DISCONNECT) from the IPCallControl module if the PSTN was the
event source, or from the PSTNCallControl module if the IP was the event source. The call state
transitions to callDropping.
6.1.5
GWCall::callIPAccepting
The application waits for a GCEV_CONNECTED event from the PSTN. Upon receipt of the event
it calls processEvent(USR_ANSWER) from the IPCallControl module and the call state
transitions to callPSTNConnected.
If the application receives a GCEV_ACCEPT event, it ignores the event and remains in the
callIPAccepting state.
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
43
Demo State Machines
If the application receives a GCEV_DISCONNECTED or a GCEV_TASKFAIL event, it sets the
drop reason by calling getResultValue( ) from the GCCallControl module. The application then
calls processEvent(USR_DISCONNECT) from the IPCallControl module if the PSTN was the
event source, or from the PSTNCallControl module if the IP was the event source. The call state
transitions to callDropping.
6.1.6
GWCall::callPSTNConnected
The application waits for a GCEV_ANSWERED event from the IP. Upon receipt of the event, the
call state transitions to callConnected.
If the application receives a GCEV_DISCONNECTED or a GCEV_TASKFAIL event, it sets the
drop reason by calling getResultValue( ) from the GCCallControl module. The application then
calls processEvent(USR_DISCONNECT) from the IPCallControl module if the PSTN was the
event source, or from the PSTNCallControl module if the IP was the event source. The call state
transitions to callDropping.
6.1.7
GWCall::callConnected
The application waits for a GCEV_DISCONNECTED or GCEV_TASKFAIL event. Upon receipt
of either event, it sets the drop reason by calling getResultValue( ) from the GCCallControl
module. The application then calls processEvent(USR_DISCONNECT) from the IPCallControl
module if the PSTN was the event source, or from the PSTNCallControl module if the IP was the
event source. The call state transitions to callDropping.
The caller may also use the keyboard to send a User Input Indication, Facility Message, or a Nonstandard Command. The application receives the appropriate event (USR_SEND_UII,
USR_SEND_FACILITY, USR_SEND_NS_COMMAND) and calls processEvent( ) from the
IPCallControl module. The call state remains in the callConnected state.
6.1.8
GWCall::callDropping
The application waits for a GCEV_DROPCALL event. Upon receipt of the event, it calls
isDropped( ) from both the IPCallControl and PSTNCallControl modules. If both sides return
TRUE, the call state transitions to callReleasing and the application unroutes the call.
If the application receives a GCEV_ALARM, GCEV_EXTENSIONCMPLT, or
GCEV_TASKFAIL event, it ignores the event and remains in the callDropping state.
6.1.9
GWCall::callReleasing
The application waits for a GCEV_RELEASECALL event. Upon receipt of the event, it calls
isReleased( ) from both the IPCallControl and PSTNCallControl modules. If both sides return
TRUE, the call state transitions to callNull.
If the application receives a GCEV_ALARM event, it ignores the event and remains in the
callReleasing state.
44
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo State Machines
6.2
GWCall State Machine - Inbound Call from PSTN
This section describes the state machine for an inbound call from the Public Switched Telephone
Network (PSTN) and contains the following topics:
• GWCall State Machine Description - Inbound from PSTN
• GWCall::callNull State
• GWCall::callPSTNDetected
• GWCall::callPSTNOffered
• GWCall::callPSTNAccepting
• GWCall::callIPConnected
• GWCall::callConnected
• GWCall::callDropping
• GWCall::callReleasing
6.2.1
GWCall State Machine Description - Inbound from PSTN
All channels are initialized to the NULL state upon application start.
As soon as an event is received, the event type, the channel number, and the reason for the event (if
there is one), are analyzed and the appropriate state machine function is called.
After all the operations are performed within the channel's event state, the state machine function is
updated.
The following state diagram describes the call states for the GWCall class for an inbound call from
the PSTN.
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
45
Demo State Machines
Figure 7. GWCall State Machine - Inbound Call from PSTN
18//
*&(9B5(/($6(&$//
PBS,3&DOO&RQWURO!LV5HOHDVHG
PBS3671&DOO&RQWURO!LV5HOHDVHG
*&(9B2))(5('IURP3671
PBS3671&DOO&RQWURO!JHW'HVW$GGU
PBS,3&DOO&RQWURO!SURFHVV(YHQW
865B0$.(&$//
URXWHWKHFDOO
*&(9B'(7(&7('
IURP3671
5(/($6,1*
*&(9B$/$50
3671B'(7(&7('
*&(9B2))(5('IURP3671
PBS3671&DOO&RQWURO!SURFHVV(YHQW
PBS3671&DOO&RQWURO!JHW'HVW$GGU
PBS,3&DOO&RQWURO!SURFHVV(YHQW
865B0$.(&$//
URXWHWKHFDOO
*&(9B'523&$//
PBS,3&DOO&RQWURO!LV'URSSHG
PBS3671&DOO&RQWURO!LV'URSSHG
XQURXWHWKHFDOO
3671B2))(5('
*&(9B&$//352&
*&(9B352&((',1*
*&(9B$/(57,1*IURP,3
PBS3671&DOO&RQWURO!SURFHVV(YHQW
865B$&&(37
'5233,1*
*&(9B$/$50
*&(9B(;7(16,21&03/7
*&(9B7$6.)$,/
*&(9B&211(&7('IURP,3
PBS3671&DOO&RQWURO!SURFHVV(YHQW
865B$16:(5
3671B$&&(37,1*
*&(9B',6&211(&7('
*&(9B7$6.)$,/
PBS3671&DOO&RQWURO!SURFHVV(YHQW
865B',6&211(&7LIIURP,3
RU
PBS,3&DOO&RQWURO!SURFHVV(YHQW
865B',6&211(&7LIIURP3671
&211(&7('
865B6(1'B8,,
865B6(1'B)$&,/,7<
865B6(1'B16B&200$1'
PBS,3&DOO&RQWURO!SURFHVV(YHQW
6.2.2
*&(9B$&&(37
*&(9B&$//352&
*&(9B&211(&7('IURP,3
PBS3671&DOO&RQWURO!SURFHVV(YHQW
865B$16:(5
*&(9B$/$50
,3B&211(&7('
*&(9B$16:(5('IURP,3
GWCall::callNull State
The application waits in the gateNull state for an GCEV_OFFERED event from the PSTN. Upon
receipt of the event, the application sets the remote phone number for making the call by calling
getDestAddr( ) from the PSTNCallControl module. It then calls
46
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo State Machines
processEvent(USR_MAKECALL) from the IPCallControl module. The application routes the
call and the call state transitions to callPSTNOffered.
If the application receives a GCEV_DETECTED event, the call state transitions to
callPSTNDetected.
If the application receives a GCEV_DISCONNECTED event, it sets the drop reason by calling
getResultValue( ) from the GCCallControl module. The application then calls
processEvent(USR_DISCONNECT) from the IPCallControl module if the PSTN was the event
source, or from the PSTNCallControl module if the IP was the event source. The call state
transitions to callDropping.
6.2.3
GWCall::callPSTNDetected
The application waits for a GCEV_OFFERED event from the PSTN. Upon receipt of the event, the
application calls processEvent( ) from the PSTNCallControl module. The application then sets the
remote phone number for making the call by calling getDestAddr( ) from the PSTNCallControl
module. It then calls processEvent(USR_MAKECALL) from the IPCallControl module. The
application routes the call and the call state transitions to callPSTNOffered.
6.2.4
GWCall::callPSTNOffered
The application waits for either a GCEV_CONNECTED or a GCEV_ALERTING event from the
IP.
In the case of a GCEV_CONNECTED event, the application calls
processEvent(USR_ANSWER) from the PSTNCallControl module and the call state transitions
to callIPConnected.
In the case of a GCEV_ALERTING event, the application calls processEvent(USR_ACCEPT)
from the PSTNCallControl module and the call state transitions to callPSTNAccepting.
If the application receives a GCEV_CALLPROC or a GCEV_PROCEEDING event, it ignores the
event and remains in the callPSTNOffered state.
If the application receives a GCEV_DISCONNECTED or a GCEV_TASKFAIL event, it sets the
drop reason by calling getResultValue( ) from the GCCallControl module. The application then
calls processEvent(USR_DISCONNECT) from the IPCallControl module if the PSTN was the
event source, or from the PSTNCallControl module if the IP was the event source. The call state
transitions to callDropping.
6.2.5
GWCall::callPSTNAccepting
The application waits for a GCEV_CONNECTED event from the IP. Upon receiving the event it
calls processEvent(USR_ANSWER) from the PSTNCallControl module and the call state
transitions to callIPConnected.
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
47
Demo State Machines
If the application receives a GCEV_CALLPROC or a GCEV_ACCEPT event, it ignores the event
and remains in the callPSTNAccepting state.
If the application receives a GCEV_DISCONNECTED or a GCEV_TASKFAIL event, it sets the
drop reason by calling getResultValue( ) from the GCCallControl module. The application then
calls processEvent(USR_DISCONNECT) from the IPCallControl module if the PSTN was the
event source, or from the PSTNCallControl module if the IP was the event source. The call state
transitions to callDropping.
6.2.6
GWCall::callIPConnected
The application waits for a GCEV_ANSWERED from the PSTN. Upon receipt of the event the call
state transitions to callConnected.
If the application receives a GCEV_EXTENSION event, it ignores the event and remains in the
callIPConnected state.
The caller may also use the keyboard to send a User Input Indication, Facility Message, or a Nonstandard Command. The application receives the appropriate event (USR_SEND_UII,
USR_SEND_FACILITY, USR_SEND_NS_COMMAND) and calls processEvent( ) from the
IPCallControl module. The call state remains in the callIPConnected state.
If the application receives a GCEV_DISCONNECTED or a GCEV_TASKFAIL event, it sets the
drop reason by calling getResultValue( ) from the GCCallControl module. The application then
calls processEvent(USR_DISCONNECT) from the IPCallControl module if the PSTN was the
event source, or from the PSTNCallControl module if the IP was the event source. The call state
transitions to callDropping.
6.2.7
GWCall::callConnected
The application waits for a GCEV_DISCONNECTED or GCEV_TASKFAIL event. Upon receipt
of either event, it sets the drop reason by calling getResultValue( ) from the GCCallControl
module. The application then calls processEvent(USR_DISCONNECT) from the IPCallControl
module if the PSTN was the event source, or from the PSTNCallControl module if the IP was the
event source. The call state transitions to callDropping.
The caller may also use the keyboard to send a User Input Indication, Facility Message, or a Nonstandard Command. The application receives the appropriate event (USR_SEND_UII,
USR_SEND_FACILITY, USR_SEND_NS_COMMAND) and calls processEvent( ) from the
IPCallControl module. The call state remains in the callConnected state.
6.2.8
GWCall::callDropping
The application waits for a GCEV_DROPCALL event. Upon receipt of the event, it calls
isDropped( ) from both the IPCallControl and PSTNCallControl modules. If both sides return
TRUE, the call state transitions to callReleasing and the application unroutes the call.
48
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo State Machines
If the application receives a GCEV_ALARM, GCEV_EXTENSIONCMPLT, or
GCEV_TASKFAIL event, it ignores the event and remains in the callDropping state.
6.2.9
GWCall::callReleasing
The application waits for a GCEV_RELEASECALL event. Upon receipt of the event, it calls
isReleased( ) from both the IPCallControl and PSTNCallControl modules. If both sides return
TRUE, the call state transitions to callNull.
If the application receives a GCEV_ALARM event, it ignores the event and remains in the
callReleasing state.
6.3
PSTNCallControl State Machine
This section describes the PSTNCallControl state machine. It contains the following topics:
• PSTNCallControl State Machine Description
• PSTNCallControl::Null State
• PSTNCallControl::Detected State
• PSTNCallControl::Offered State
• PSTNCallControl::Accepting State
• PSTNCallControl::Answering State
• PSTNCallControl::makingCall State
• PSTNCallControl::Connected State
• PSTNCallControl::Dropping State
• PSTNCallControl::Releasing State
6.3.1
PSTNCallControl State Machine Description
All channels are initialized to the NULL state upon application start.
As soon as an event is received, the event type, the channel number, and the reason for the event (if
there is one), are analyzed and the appropriate state machine function is called.
After all the operations are performed within the channel's event state, the state machine function is
updated.
The following state diagram describes the call states for the PSTNCallControl class.
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
49
Demo State Machines
Figure 8. PSTNCallControl State Machine
*&(9B&$//352&
18//
*&(9B2))(5('
JHW&DOO$GGU,QIR
DFFHSW&DOO
*&(9B'(7(&7('
*&(9B5(/($6(&$//
'(7(&7('
865B0$.(&$//
PDNH&DOO
5(/($6,1*
*&(9B2))(5('
JHW&DOO$GGU,QIR
JHWDQGVHW'1,6DQG$1,
FDOO$FN
2))(5('
0$.,1*B&$//
*&(9B'523&$//
UHOHDVH&DOO
865B$&&(37
DFFHSW&DOO
$&&(37,1*
'5233,1*
865B$16:(5
DQVZHU&DOO
865B$16:(5
DQVZHU&DOO
*&(9B&211(&7('
*&(9B',6&211(&7('
865B',6&211(&7
GURS&DOO
$16:(5,1*
*&(9B$16:(5('
&211(&7('
6.3.2
PSTNCallControl::Null State
The application waits for a GCEV_DETECTED, GCEV_OFFERED, or USR_MAKECALL event.
In the case of a GCEV_DETECTED event, the state transitions to the Detected state.
50
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo State Machines
In the case of a GCEV_OFFERED event, the application calls getCallAddrInfo( ) to get and set
DNIS and ANI and then calls acceptCall( ). The state transitions to the Accepting state.
In the case of a USR_MAKECALL event, the application calls makeCall( ) and the state
transitions to makingCall.
If the application receives a GCEV_DISCONNECTED event, it calls getResultValue( ) to get the
disconnect reason and then calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
If the application receives a USR_DISCONNECT event it retrieves the DropReason from the
EventData and calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
6.3.3
PSTNCallControl::Detected State
The application waits for a GCEV_OFFERED event. Upon receipt of the event, it calls
getCallAddrInfo( ) to get and set DNIS and ANI and then calls callAck( ). The state transitions to
the Offered state.
If the application receives a GCEV_DISCONNECTED event, it calls getResultValue( ) to get the
disconnect reason and then calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the call state transitions to Init. Otherwise, the state
transitions to Dropping.
If the application receives a USR_DISCONNECT event it retrieves the DropReason from the
EventData and calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
6.3.4
PSTNCallControl::Offered State
The application waits for a USR_ACCEPT or USR_ANSWER event.
In the case of USR_ACCEPT, the application calls acceptCall( ) and the state transitions to
Accepting.
In the case of USR_ANSWER, the application calls answerCall( ) and the state transitions to
Answering.
If the application receives a GCEV_DISCONNECTED event, it calls getResultValue( ) to get the
disconnect reason and then calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
If the application receives a USR_DISCONNECT event it retrieves the DropReason from the
EventData and calls dropCall( ). If the dropCall( ) function fails, the application calls
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
51
Demo State Machines
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
6.3.5
PSTNCallControl::Accepting State
The application waits for a USR_ANSWER event. Upon receipt of the event, it calls answerCall( )
and the state transitions to Answering.
If the application receives a GCEV_ACCEPT event, it ignores the event and remains in the
Accepting state.
If the application receives a GCEV_DISCONNECTED or GCEV_TASKFAIL event, it calls
getResultValue( ) to get the disconnect reason and then calls dropCall( ). If the dropCall( )
function fails, the application calls resetLineDevice( ) to reset the line device and the state
transitions to Init. Otherwise, the state transitions to Dropping.
If the application receives a USR_DISCONNECT event it retrieves the DropReason from the
EventData and calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
6.3.6
PSTNCallControl::Answering State
The application waits for a GCEV_ANSWERED event. Upon receipt of the event, the state
transitions to Connected.
If the application receives a GCEV_DISCONNECTED or GCEV_TASKFAIL event, it calls
getResultValue( ) to get the disconnect reason and then calls dropCall( ). If the dropCall( )
function fails, the application calls resetLineDevice( ) to reset the line device and the state
transitions to Init. Otherwise, the state transitions to Dropping.
If the application receives a USR_DISCONNECT event it retrieves the DropReason from the
EventData and calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
6.3.7
PSTNCallControl::makingCall State
The application waits for a GCEV_CONNECTED event. Upon receipt of the event, the state
transitions to Connected.
If the application receives a GCEV_ALERTING or GCEV_PROCEEDING event, it ignores the
event and remains in the makingCall state.
If the application receives a GCEV_DISCONNECTED event, it calls getResultValue( ) to get the
disconnect reason and then calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
52
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo State Machines
If the application receives a USR_DISCONNECT event it retrieves the DropReason from the
EventData and calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
6.3.8
PSTNCallControl::Connected State
The application waits for a GCEV_DISCONNECTED or USR_DISCONNECT event. In the case
of GCEV_DISCONNECTED, the application calls getResultValue( ) to get the disconnect reason
and then calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
In the case of USR_DISCONNECT, the application retrieves the DropReason from the EventData
and calls dropCall( ). If the dropCall( ) function fails, the application calls resetLineDevice( ) to
reset the line device and the state transitions to Init. Otherwise, the state transitions to Dropping.
6.3.9
PSTNCallControl::Dropping State
The application waits for a GCEV_DROPCALL event. Upon receipt of the event, it calls
releaseCall( ) and the state transitions to Releasing.
6.3.10
PSTNCallControl::Releasing State
The application waits for a GCEV_RELEASECALL event. Upon receipt of the event, the state
transitions to Null.
6.4
IPCallControl State Machine
This section describes the PSTNCallControl state machine. It contains the following topics:
• IPCallControl State Machine Description
• IPCallControl::Null State
• IPCallControl::getCallInfo State
• IPCallControl::offered State
• IPCallControl::accepting State
• IPCallControl::answering State
• IPCallControl::makingCall State
• IPCallControl::connected State
• IPCallControl::dropping State
• IPCallControl::dropped State
• IPCallControl::releasing State
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
53
Demo State Machines
6.4.1
IPCallControl State Machine Description
All channels are initialized to the NULL state upon application start.
As soon as an event is received, the event type, the channel number, and the reason for the event (if
there is one), are analyzed and the appropriate state machine function is called.
After all the operations are performed within the channel's event state, the state machine function is
updated.
The following state diagram describes the call states for the IPCallControl class.
54
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo State Machines
Figure 9. IPCallControl State Machine
18//
*&(9B5(/($6(&$//
865B0$.(&$//
PDNH&DOO
*&(9B2))(5('
JHW&DOO$GGU,QIR
JHW,QFRPLQJ&DOO,QIR
FDOO$FN
5(/($6,1*
*&(9B2))(5('
JHW&DOO$GGU,QIR
JHW,QFRPLQJ&DOO,QIRIDLOV
*&(9B&$//352&
*(7B&$//B,1)2
*&(9B(;7(16,21&03/7
UHOHDVH&DOO
*&(9B(;7(16,21&03/7
JHW([WHQVLRQ,QIR
0$.,1*B&$//
*&(9B$/(57,1*
*&(9B352&((',1*
*&(9B'523&$//
'5233('
UHOHDVH&DOO
*&(9B$/$50
SULQW4R6
2))(5('
865B$&&(37
DFFHSW&DOO
*&(9B'523&$//
JHW'URS&DOO,QIR
*&(9B&$//352&
$&&(37,1*
*&(9B(;7(16,21
'5233,1*
*&(9B$/$50
SULQW4R6
*&(9B&211(&7('
*&(9B',6&211(&7('
JHW5HVXOW9DOXH
GURS&DOO
RU
865B',6&211(&7
GURS&DOO
*&(9B
$&&(37
865B$16:(5
DQVZHU&DOO
865B$16:(5
DQVZHU&DOO
$16:(5,1*
*&(9B$16:(5('
&211(&7('
865B6(1'B8,,
VHQG8,,
865B6(1'B)$&,/,7<
VHQG)DFLOLW\0HVVDJH
865B6(1'B16B&200$1'
VHQG1RQVWDQGDUG&RPPDQG
*&(9B$/$50
SULQW4R6
6.4.2
*&(9B(;7(16,21
JHW([WHQVLRQ,QIR
IPCallControl::Null State
The application waits for a GCEV_OFFERED or USR_MAKECALL event. In the case of
GCEV_OFFERED, the application calls getCallAddrInfo( ) to get the destination and originator
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
55
Demo State Machines
from the IP message and set the member variables. The application then calls
getIncomingCallInfo( ) which calls gc_Extension( ) to request extension information from the IP.
If the function fails, the application does not wait for the complete message and the state transitions
to Connected. Otherwise, the application calls callAck( ) and the state transitions to getCallInfo.
In the case of USR_MAKECALL, the application calls makeCall( ) and the state transitions to
makingCall.
If the application receives a GCEV_DISCONNECTED event, it calls getResultValue( ) to get the
disconnect reason and then calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
If the application receives a USR_DISCONNECT event it retrieves the DropReason from the
EventData and calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
6.4.3
IPCallControl::getCallInfo State
The application waits for a GCEV_EXTENSIONCMPLT event. The application calls
getExtensionInfo( ) and the state transitions to Offered.
If the application receives a GCEV_CALLPROC event, acknowledging the callAck( ) function, it
ignores the event and remains in the getCallInfo state.
If the application receives a GCEV_DISCONNECTED or GCEV_TASKFAIL event, it calls
getResultValue( ) to get the disconnect reason and then calls dropCall( ). If the dropCall( )
function fails, the application calls resetLineDevice( ) to reset the line device and the state
transitions to Init. Otherwise, the state transitions to Dropping.
If the application receives a USR_DISCONNECT event it retrieves the DropReason from the
EventData and calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
6.4.4
IPCallControl::offered State
The application waits for a USR_ACCEPT or USR_ANSWER event. In the case of
USR_ACCEPT, the application calls acceptCall( ) and the state transitions to Accepting.
In the case of USR_ANSWER, the application calls answerCall( ) and the state transitions to
Answering.
If the application receives a GCEV_CALLPROC event, acknowledging the callAck( ) function, it
ignores the event and remains in the Offered state.
If the application receives a GCEV_DISCONNECTED or GCEV_TASKFAIL event, it calls
getResultValue( ) to get the disconnect reason and then calls dropCall( ). If the dropCall( )
56
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo State Machines
function fails, the application calls resetLineDevice( ) to reset the line device and the state
transitions to Init. Otherwise, the state transitions to Dropping.
If the application receives a USR_DISCONNECT event it retrieves the DropReason from the
EventData and calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
6.4.5
IPCallControl::accepting State
The application waits for a USR_ANSWER event. Upon receipt of the event, it calls answerCall( )
and the state transitions to Answering.
If the application receives a GCEV_ACCEPT event, it ignores the event and remains in the
Accepting state.
If the application receives a GCEV_DISCONNECTED or GCEV_TASKFAIL event, it calls
getResultValue( ) to get the disconnect reason and then calls dropCall( ). If the dropCall( )
function fails, the application calls resetLineDevice( ) to reset the line device and the state
transitions to Init. Otherwise, the state transitions to Dropping.
If the application receives a USR_DISCONNECT event it retrieves the DropReason from the
EventData and calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
6.4.6
IPCallControl::answering State
The application waits for a GCEV_ANSWERED event. Upon receipt of the event the state
transitions to Connected.
If the application receives a GCEV_DISCONNECTED or GCEV_TASKFAIL event, it calls
getResultValue( ) to get the disconnect reason and then calls dropCall( ). If the dropCall( )
function fails, the application calls resetLineDevice( ) to reset the line device and the state
transitions to Init. Otherwise, the state transitions to Dropping.
If the application receives a USR_DISCONNECT event it retrieves the DropReason from the
EventData and calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
6.4.7
IPCallControl::makingCall State
The application waits for a GCEV_CONNECTED event. Upon receipt of the event, the state
transitions to Connected.
If the application receives a GCEV_ALERTING or GCEV_PROCEEDING event, it ignores the
event and remains in the makingCall state.
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
57
Demo State Machines
If the application receives a GCEV_DISCONNECTED or GCEV_TASKFAIL event, it calls
getResultValue( ) to get the disconnect reason and then calls dropCall( ). If the dropCall( )
function fails, the application calls resetLineDevice( ) to reset the line device and the state
transitions to Init. Otherwise, the state transitions to Dropping.
If the application receives a USR_DISCONNECT event it retrieves the DropReason from the
EventData and calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
6.4.8
IPCallControl::connected State
The application waits for a GCEV_DISCONNECTED or USR_DISCONNECT event. In the case
of GCEV_DISCONNECTED, the application calls getResultValue( ) to get the disconnect reason
and then calls dropCall( ). If the dropCall( ) function fails, the application calls
resetLineDevice( ) to reset the line device and the state transitions to Init. Otherwise, the state
transitions to Dropping.
In the case of USR_DISCONNECT, the application retrieves the DropReason from the EventData
and calls dropCall( ). If the dropCall( ) function fails, the application calls resetLineDevice( ) to
reset the line device and the state transitions to Init. Otherwise, the state transitions to Dropping.
If the application receives a GCEV_EXTENSION event, it calls getExtensionInfo( ) and remains
in the Connected state.
If the application receives a USR_SEND_UII event, it calls sendUII( ) and remains in the
Connected state.
If the application receives a USR_SEND_FACILITY event, it calls sendFacilityMessage( ) and
remains in the Connected state.
If the application receives a USR_SEND_NS_COMMAND event, it calls
sendNonstandardCommand( ) and remains in the Connected state.
If the application receives a GCEV_ALARM event, it calls printQoS( ) and remains in the
Connected state.
6.4.9
IPCallControl::dropping State
The application waits for a GCEV_DROPCALL event. Upon receipt of the event, it calls
getDropCallInfo( ), which calls gc_Extension( ) and the state transitions to Dropped.
If the application receives a GCEV_EXTENSION event, it ignores the event and remains in the
Dropping state.
If the application receives a GCEV_ALARM event, it calls printQoS( ) and remains in the
Dropping state.
58
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Demo State Machines
6.4.10
IPCallControl::dropped State
The application waits for a GCEV_EXTENSIONCMPLT event. Upon receipt of the event it calls
releaseCall( ) and the state transitions to Releasing.
If the application receives a GCEV_ALARM event, it calls printQoS( ) and remains in the
Dropped state.
6.4.11
IPCallControl::releasing State
The application waits for a GCEV_RELEASECALL event. Upon receipt of the event the state
transitions to Null.
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
59
Demo State Machines
60
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Glossary
Codec: see COder/DECoder
COder/DECoder: A circuit used to convert analog voice data to digital and digital voice data to analog audio.
Computer Telephony (CT): Adding computer intelligence to the making, receiving, and managing of
telephone calls.
DTMF: Dual-Tone Multi-Frequency
Dual-Tone Multi-Frequency: A way of signaling consisting of a push-button or touch-tone dial that sends out a
sound consisting of two discrete tones that are picked up and interpreted by telephone switches (either PBXs or
central offices).
Emitting Gateway: called by a G3FE. It initiates IFT service for the calling G3FE and connects to a Receiving
Gateway.
E1: The 2.048 Mbps digital carrier system common in Europe.
FCD file: An ASCII file that lists any non-default parameter settings that are necessary to configure a Dialogic®
DM3 hardware/firmware product for a particular feature set. The downloader utility reads this file, and for each
parameter listed generates and sends the DM3 message necessary to set that parameter value.
Frame: A set of SCbus/CT Bus timeslots which are grouped together for synchronization purposes. The period of
a frame is fixed (at 125 µsec) so that the number of time slots per frame depends on the SCbus/CT Bus data rate.
G3FE: Group 3 Fax Equipment. A traditional fax machine with analog PSTN interface.
Gatekeeper: An H.323 entity on the Internet that provides address translation and control access to the network
for H.323 Terminals and Gateways. The Gatekeeper may also provide other services to the H.323 terminals and
Gateways, such as bandwidth management and locating Gateways.
Gateway: A device that converts data into the IP protocol. It often refers to a voice-to-IP device that converts an
analog voice stream, or a digitized version of the voice, into IP packets.
H.323: A set of International Telecommunication Union (ITU) standards that define a framework for the
transmission of real-time voice communications through Internet protocol (IP)-based packet-switched networks.
The H.323 standards define a gateway and a gatekeeper for customers who need their existing IP networks to
support voice communications.
IAF: Internet Aware Fax. The combination of a G3FE and a T.38 gateway.
IFP: Internet Facsimile Protocol
IFT: Internet Facsimile Transfer
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
61
International Telecommunications Union (ITU): An organization established by the United Nations to set
telecommunications standards, allocate frequencies to various uses, and hold trade shows every four years.
Internet: An inter-network of networks interconnected by bridges or routers. LANs described in H.323 may be
considered part of such inter-networks.
Internet Protocol (IP): The network layer protocol of the transmission control protocol/Internet protocol
(TCP/IP) suite. Defined in STD 5, Request for Comments (RFC) 791. It is a connectionless, best-effort packet
switching protocol.
Internet Service Provider (ISP): A vendor who provides direct access to the Internet.
Internet Telephony: The transmission of voice over an Internet Protocol (IP) network. Also called Voice over IP
(VoIP), IP telephony enables users to make telephone calls over the Internet, intranets, or private Local Area
Networks (LANs) and Wide Area Networks (WANs) that use the Transmission Control Protocol/Internet Protocol
(TCP/IP).
ITU: See International Telecommunications Union.
Jitter: The deviation of a transmission signal in time or phase. It can introduce errors and loss of synchronization
in high-speed synchronous communications.
NIC (Network Interface Card): Adapter card inserted into computer that contains necessary software and
electronics to enable a station to communicate over network.
PCD file: An ASCII text file that contains product or platform configuration description information that is used
by the DM3 downloader utility program. Each of these files identifies the hardware configuration and firmware
modules that make up a specific hardware/firmware product. Each type of Dialogic DM3-based product used in a
system requires a product-specific PCD file.
PSTN: see Public Switched Telephone Network
Public Switched Telephone Network: The telecommunications network commonly accessed by standard
telephones, key systems, Private Branch Exchange (PBX) trunks and data equipment.
Reliable Channel: A transport connection used for reliable transmission of an information stream from its
source to one or more destinations.
Reliable Transmission: Transmission of messages from a sender to a receiver using connection-mode data
transmission. The transmission service guarantees sequenced, error-free, flow-controlled transmission of messages
to the receiver for the duration of the transport connection.
RTCP: Real Time Control Protocol
RTP: Real Time Protocol
SIP: Session Initiation Protocol: an Internet standard specified by the Internet Engineering Task Force (IETF) in
RFC 3261. SIP is used to initiate, manage, and terminate interactive sessions between one or more users on the
Internet.
62
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
T1: A digital transmission link with a capacity of 1.544 Mbps used in North America. Typically channeled into 24
digital subscriber level zeros (DS0s), each capable of carrying a single voice conversation or data stream. T1 uses
two pairs of twisted pair wires.
TCP: see Transmission Control Protocol
Terminal: An H.323 Terminal is an endpoint on the local area network which provides for real-time, two-way
communications with another H.323 terminal, Gateway, or Multipoint Control Unit. This communication consists
of control, indications, audio, moving color video pictures, and/or data between the two terminals. A terminal may
provide speech only, speech and data, speech and video, or speech, data, and video.
Transmission Control Protocol: The TCP/IP standard transport level protocol that provides the reliable, full
duplex, stream service on which many application protocols depend. TCP allows a process on one machine to send
a stream of data to a process on another. It is connection-oriented in the sense that before transmitting data,
participants must establish a connection.
UDP: see User Datagram Protocol
UDPTL: Facsimile UDP Transport Layer protocol
User Datagram Protocol: The TCP/IP standard protocol that allows an application program on one machine to
send a datagram to an application program on another machine. Conceptually, the important difference between
UDP datagrams and IP datagrams is that UDP includes a protocol port number, allowing the sender to distinguish
among multiple destinations on the remote machine.
VAD: Voice Activity Detection
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
63
64
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
Index
Symbols
{while(1)} 38
A
acceptCall( ) 51, 56
answerCall( ) 51, 52, 56, 57
C
callAck( ) 51, 56
callback_hdlr( ) 38
Channel Class 29
Class Diagram 29
Configuration Class 30
D
Demo Description 11
Demo Details 25
Demo Options 21
Demo Source Code Files 25
Demo State Machines 41
DigitalPSTNBoard Class 33
dropCall( ) 51, 52, 53, 56, 57, 58
E
Event Handling 38
Event Mechanism 38
F
getDropCallInfo( ) 58
getExtensionInfo( ) 56, 58
getIncomingCallInfo( ) 56
getResultValue( ) 43, 44, 47, 48, 51, 52, 53, 56, 57, 58
GWCall
gateNull State 42, 46, 50, 51, 52, 53, 55, 56
GWCall Class 32
GWCall State Machine - Inbound Call from IP 41, 45
GWCall State Machine - Inbound Call from PSTN 45
GWCall State Machine Description - Inbound from IP 41, 45
H
Handling Application Exit Events 39
Handling Keyboard Input Events 38
Handling SRL Events 38
Hardware Requirements 13
I
init( ) 37, 38
Initialization 36
IPCallControl Class 32
IPCallControl State Machine 53
IPMediaBoard Class 32
IPMediaDevice Class 33
isDropped( ) 44, 48
isReleased( ) 44, 49
M
Files Used by the Demo 25
main( ) 37, 38, 39
makeCall( ) 51, 56
G
P
gc_Extension( ) 56, 58
gc_GetMetaEvent( ) 39
gc_OpenEx( ) 35
gc_Start( ) 37
getCallAddrInfo( ) 51, 55
getDestAddr( ) 43, 46, 47
PDL Files 27
PDLSetApplicationExitPath( ) 39
PDLsr_enbhdlr( ) 37, 38
PDLsr_getevtdev( ) 38
PDLsr_getevttype( ) 39
printAllLibs( ) 37
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation
65
printQoS( ) 58, 59
processEvent( ) 44, 47, 48
processEvent(CCEV_OFFERED) 43
processEvent(USR_ACCEPT) 43, 47
processEvent(USR_ANSWER) 43, 47
processEvent(USR_DISCONNECT) 43, 44, 47, 48
processEvent(USR_MAKECALL) 43, 47
Programming Model Classes 28
PSTNCallControl Class 33
PSTNCallControl State Machine 49
R
R4Device Class 35
R4LogicalBoard Class 35
releaseCall( ) 53, 59
resetLineDevice( ) 51, 52, 53, 56, 57, 58
ResourceManager Class 33
resourceManager.configure( ) 37
resourceManager.getChannelsNum( ) 37
resourceManager.init( ) 37
Running the Demo 21
S
sendFacilityMessage( ) 58
sendNonstandardCommand( ) 58
sendUII( ) 58
Software Requirements 13
sr_enblhdlr( ) 36
Starting the Demo 21
Stopping the Demo 23
System Requirements 13
T
Threads 36
U
Using the Demo 22
Utility Files 27
W
waitForKey( ) 38
66
Dialogic® IP Gateway (Global Call) Demo Guide — May 2008
Dialogic Corporation

advertisement

Key Features

  • Accepts IP calls
  • Places IP calls
  • Accepts PSTN calls
  • Places PSTN calls
  • Configuration file for hardware and parameter settings
  • Command line options for running the demo executable file
  • Output log files
  • Printing and output tracing to the monitor
  • QoS (Quality of Service)

Frequently Answers and Questions

What is the Dialogic® IP Gateway (Global Call) demo?
The Dialogic® IP Gateway (Global Call) demo is a host-based application that demonstrates using the Dialogic® Global Call API to build a PSTN-IP gateway. The demo source code can be used as sample code for those who choose to begin developing an application from a working application.
What are the features of the Dialogic® IP Gateway (Global Call) demo?
The demo supports the following features: • Accepts IP calls • Places IP calls • Accepts PSTN calls • Places PSTN calls • Configuration file for hardware and parameter settings • Command line options for running the demo executable file • Output log files • Printing and output tracing to the monitor • QoS (Quality of Service)
What are the system requirements for the Dialogic® IP Gateway (Global Call) demo?
To run the Dialogic® IP Gateway (Global Call) demo, you need: • Dialogic® Digital Network Interface board • Network Interface Card (NIC) • IP network cable
How do I configure the Dialogic® IP Gateway (Global Call) demo?
Before running the Dialogic® IP Gateway (Global Call) demo, you need to modify the gateway.cfg file to reflect your system environment.

Related manuals

Download PDF

advertisement