Global Call API for Host Media
Processing on Windows
Programming Guide
August 2006
05-2409-003
INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL® PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY
ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN
INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS
ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES
RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER
INTELLECTUAL PROPERTY RIGHT. Intel products are not intended for use in medical, life saving, life sustaining, critical control or safety systems, or
nuclear facility applications.
Intel may make changes to specifications and product descriptions at any time, without notice.
This Global Call API for Host Media Processing on Windows Programming Guide as well as the software described in it is furnished under license and
may only be used or copied in accordance with the terms of the license. The information in this manual is furnished for informational use only, is
subject to change without notice, and should not be construed as a commitment by Intel Corporation. Intel Corporation assumes no responsibility or
liability for any errors or inaccuracies that may appear in this document or any software that may be provided in association with this document.
Except as permitted by such license, no part of this document may be reproduced, stored in a retrieval system, or transmitted in any form or by any
means without the express written consent of Intel Corporation.
Dialogic, Intel, Intel logo, and Intel NetStructure are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States
and other countries.
* Other names and brands may be claimed as the property of others.
Publication Date: August 2006
Document Number: 05-2409-003
Intel
1515 Route 10
Parsippany, NJ 07054
For Technical Support, visit the Intel Telecom Support Resources website at:
http://developer.intel.com/design/telecom/support
For Products and Services Information, visit the Intel Telecom and Compute Products website at:
Global Call API for HMP on Windows Programming Guide – August 20069
Contents
10Global Call API for HMP on Windows Programming Guide – August 2006
Revision History
This revision history summarizes the changes made in each published version of this document.
Document No.Publication DateDescription of Revisions
05-2409-003 August 2006 Call Control Libraries section: Updated the library descriptions to identify the
technologies/protocols that each library supports.
Using Protocols (Flexible Routing) section: Removed incorrect reference to using the
DM3 PDK Manager.
Setting Call Analysis Attributes on a Per Call Basis section: Updated to indicate that
PAMD_QUAL2TMP is not supported and to provide a pointer to a related Tech
Note.
Debugging chapter : Added reference to the “Runtime Trace Facility (RTF) Reference”
chapter in the Intel Dialogic System Diagnostics Guide.
05-2409-002October 2005Global change: Added support for protocols that can be run on the E1 or T1
interfaces provided by Intel NetStructure
Global change: Updates to recognize the Intel NetStructure
Starting Call Control Libraries section : Added note about loading only the required
call control libraries to keep the required memory footprint small.
Overlap Sending section : Explicitly mentioned ISDN in the list of technologies that do
not have messages to request more information.
Configuring Default Call Progress Analysis Parameters section: Added a note that
pre-connect call progress is enabled by default, regardless of the CPA setting in
the CONFIG file
Real Time Configuration Management chapter : Fixed several references to
gc_util_insert_val( ) and gc_util_insert_ref( ) which should be
gc_util_insert_parm_val( ) and gc_util_insert_parm_ref( ).
Supervised Transfers section: Updated the call termination figure and added note to
describe the unsolicited GCEV_CONNECTED event that is generated for a call
when the new call being set up is terminated.
05-2409-001April 2005Initial version of document. Much of the information contained in this document was
previously published in the Global Call API for Windows Operating Systems Programming Guide, document number 05-1867-002.
®
Digital Network Interface boards.
®
brand.
Global Call API for HMP on Windows Programming Guide — August 200611
Revision History
12Global Call API for HMP on Windows Programming Guide — August 2006
About This Publication
The following topics provide information about this publication:
• Purpose
• Intended Audience
• How to Use This Publication
• Related Information
Purpose
This publication provides guidelines for using the Global Call API to build computer telephony
applications that require call control functionality. Such applications include, but are not limited to,
Call Routing, Enhanced Services, Unified Messaging, Voice Messaging, LAN Telephony Services,
Computer Telephony Services, Switching, PBX, Interactive Voice Response, Help Desk and Work
Flow applications. This publication is a companion guide to the Global Call API Library Reference
that provides details on the functions and parameters in the Global Call API library and the Global Call Technology Guides that provide IP-, E1/T1- and ISDN-specific information.
Host Media Processing (HMP) software performs media processing tasks on general-purpose
servers based on Intel
system, HMP performs like a virtual DM3 board to the customer application, but all media
processing takes place on the host processor. In this document, the term “board” represents the
virtual DM3 board, unless explictly noted otherwise. Intel NetStructure
boards provide physical E1 and T1 interfaces for applications that require E1/T1 network
connectivity.
®
architecture without the need for specialized hardware. When installed on a
®
Digital Network Interface
Applicability
This document is published for Intel NetStructure® Host Media Processing Software.
Intended Audience
This publication is written for the following audience:
• Distributors
• System Integrators
• Toolkit Developers
• Independent Software Vendors (ISVs)
• Value Added Resellers (VARs)
Global Call API for HMP on Windows Programming Guide — August 200613
About This Publication
• Original Equipment Manufacturers (OEMs)
How to Use This Publication
Refer to this publication after you have installed the hardware and the system software, which
includes the Global Call software.
This publication assumes that you are familiar with the Windows operating system and the C
programming language.
The information in this guide is organized as follows:
• Chapter 1, “Product Description” provides an overview of the Global Call development
software.
• Chapter 2, “Programming Models” describes the supported programming models in the
Windows environment.
• Chapter 3, “Call State Models” describes the call state models used by Global Call.
• Chapter 4, “Event Handling” describes how to handle Global Call events.
• Chapter 6, “Error Handling” describes the error handling facilities provided by Global Call.
• Chapter 5, “Application Development Guidelines” provides guidelines when developing
applications that use Global Call.
• Chapter 7, “Call Control” describes basic call control capabilities, resource routing and feature
extensions provided by Global Call.
• Chapter 8, “Alarm Handling” describes how Global Call can be used to handle alarms.
• Chapter 9, “Real Time Configuration Management” describes how Global Call can be used for
real time configuration of parameters associated with the interface.
• Chapter 10, “Handling Service Requests” describes the generic service request facility
provided by Global Call.
• Chapter 11, “Using Global Call to Implement Call Transfer” provides general information on
the implementation of unsupervised (blind) and supervised call transfer.
• Chapter 12, “Building Applications” provides guidelines for building applications that use the
Global Call software.
• Chapter 13, “Debugging” provides pointers to where technology-specific debugging
information can be obtained.
• The Glossary provides a definition of terms used in this guide.
Related Information
Refer to the following sources for more information:
• Global Call API Library Reference
• Global Call E1/T1 CAS/R2 Technology Guide
• Global Call ISDN Technology Guide
14Global Call API for HMP on Windows Programming Guide — August 2006
About This Publication
• Global Call IP Technology Guide
• Standard Runtime Library API Programming Guide.
• Standard Runtime Library API Library Reference.
• The Release Update for your HMP software, which may include updates to this manual,
available on the Telecom Support Resources website at:
Global Call development software provides a common signaling interface for network-enabled
applications, regardless of the signaling protocol needed to connect to the local telephone network.
The signaling interface provided by Global Call software facilitates the exchange of call control
messages between the telephone network and virtually any network-enabled application. Global
Call software enables developers to create applications that can work with signaling systems
worldwide, regardless of the network to which the applications are connected. The Global Call
software is ideal for high-density, network-enabled solutions, such as voice, data, and video
applications, where the supported hardware and signaling technology can vary widely from country
to country.
1
As an example, the signal acknowledgement or information flow required to establish a call may
vary from country to country. Rather than requiring the application to handle low-level details,
Global Call software offers a consistent, high-level interface to the user and handles each country's
unique protocol requirements transparently to the application.
The Global Call software comprises three major components:
Global Call Application Programming Interface (API)
A common, extensible API providing network interfaces to higher levels of software.
Application developers use API function calls in their computer telephony applications. The
Global Call API is the preferred call control interface.
Call Control Libraries
A set of libraries that provide the interface between the Global Call API and the various
network signaling protocols.
Global Call Protocols
Network signaling protocols, such as T1 Robbed Bit, E1 CAS, ISDN, QSIG, IP H.323 and SIP
can be invoked by the Global Call API to facilitate call control.
Global Call API for HMP on Windows Programming Guide — August 200617
Product Description
1.2Global Call Feature Categories
The Global Call development software provides many features allowing for the development of
flexible and robust applications. The features fall into one of two main categories:
• Call Control Features
• Operation, Administration and Maintenance Features
1.2.1Call Control Features
The Global Call development software provides the following call control features:
Basic Call Control
Includes basic call control features such as, the ability to make a call, detect a call, answer a
call, release a call, etc. The implementation of these capabilities is based on the basic call state
model, which is a common model for all network technologies. See Section 3.2, “Basic Call
Model” for more information on the basic call model.
Advanced Call Model
Defines the behavior for advanced features, such as hold and transfer. These capabilities are
provided to support technologies and protocols that support such features, for example,
Supervised Transfer. The implementation of these capabilities is based on a more advanced
call state model. See Section 3.5, “Advanced Call Control with Call Hold and Transfer” for
more information. The advanced call model applies only to E1/T1 and ISDN technologies, not
IP technology, which uses a different scheme for features such as call transfer. See the Global Call IP Technology Guide.
Call Progress and Call Analysis
Provides the capabilities for handling pre-connect (Call Progress) information that reports the
status of the call connection, such as, busy, no dial tone or no ringback, and post connect (Call
Analysis) information that reports the destination party’s media type, for example, voice,
answering machine, or fax modem. This information is determined by the detection of tones
defined specifically for this purpose. See Section 7.2, “Call Progress Analysis when Using
Digital Network Interface Boards” for more information. The call progress and call analysis
feature applies only to E1/T1 and ISDN technologies, not IP technology.
Feature Transparency and Extension (FTE)
Provides the ability to extend the capabilities of Global Call to handle features that are specific
to a particular technology so that those features are accessible via the Global Call interface.
For example, for ISDN applications, Global Call supports supplementary services such as
Overlap Send, Overlap Receive, Any Message, Any IE, and User-to-User messaging. See
Section 7.4, “Feature Transparency and Extension” for more information.
1.2.2Operation, Administration and Maintenance Features
The Global Call development software provides the following features that facilitate the operation,
administration and maintenance of Global Call applications:
Error Handling Functionality
When an error occurs, Global Call provides functions that enable an application to retrieve
more information about the error. See Chapter 6, “Error Handling” for more information.
18Global Call API for HMP on Windows Programming Guide — August 2006
Product Description
Event Handling Functionality
Provides the ability to handle and process events, including the ability to disable and enable
events and to retrieve event information. See Chapter 4, “Event Handling” for more
information.
Global Call Alarm Management System (GCAMS)
Provides the ability to manage alarms. GCAMS provides Global Call applications with the
ability to receive extensive alarm information that can be used to troubleshoot line problems.
See Chapter 8, “Alarm Handling” for more information.
Real Time Configuration Management (RTCM)
Allows the modification of call control and protocol elements in real time, providing a single
common user interface for configuration management. See Chapter 9, “Real Time
Configuration Management” for more information.
Global Call Service Request (GCSR)
Enables an application to send a request for a service to a remote device. Examples of the types
of services that this feature supports are device registration, channel setup, call setup,
information requests, or other kinds of requests that need to be made between two devices
across the network. See Chapter 10, “Handling Service Requests” for more information.
Library Information Functions
Enables an application to get information about the call control libraries being used. See the
Global Call API Library Reference for more information about these functions.
Debugging Facilities
Global Call provides powerful debugging capabilities for troubleshooting protocol-related
problems, including the ability to generate a detailed log file. See the appropriate Global Call
Technology Guide for information on the debugging facilities available when using Global
Call with each technology.
1.3Global Call Architecture
The Global Call development software architecture is based on the Intel® Dialogic® architecture
that supports Host Media Processing (HMP) software and DM3 hardware. The architecture is
described in the following topics:
• Overview
• Global Call API
1.3.1Overview
Figure 1 shows a system-level view of the Global Call architecture for IP technology and Figure 2
shows the Global Call architecture for E1/T1 and ISDN technologies on DM3 hardware.
Global Call API for HMP on Windows Programming Guide — August 200619
Product Description
Figure 1. Global Call Architecture for IP Technology
Host Application
GlobalCall
Signaling
IP Network
Call Control
Host
NIC
Media
IP Network
H.323 or SIP
Call Control
Library
(IPT CCLib)
RTP/RTCP
Media
Control
Media
Routing
IP Media
Call Control
Library
(IPM CCLib)
IP Media
Resource
20Global Call API for HMP on Windows Programming Guide — August 2006
Figure 2. Global Call Architecture for E1/T1 and ISDN Technologies
User Application
GlobalCall API
Product Description
Other
Dialogic
Libraries
1.3.2Global Call API
Call Control Library
Device Driver Operating Systems
Firmware
Network Interface
DM3CC
Firmware
Network Interface
PSTN
The Global Call API is a call control API. Similar to other Intel Dialogic APIs (such as the Voice
API), the Global Call API uses the Standard Runtime Library (SRL) API to deliver response events
to its API commands. The Global Call API and other Intel Dialogic APIs form a family of APIs
that use the underlying services provided by the SRL API.
The Global Call API provides a collection of functions supporting call control operations as well as
functions to support operation, administration and maintenance tasks. See the Global Call API Library Reference for detailed information about each function.
Global Call API for HMP on Windows Programming Guide — August 200621
Product Description
1.4Call Control Libraries
Each supported network technology requires a call control library to provide the interface between
the network and the Global Call library. The call control libraries currently supported by the
Global Call API for HMP are as follows:
GC_CUSTOM1_LIB
The first of two call control library place holders for custom call control libraries. Any thirdparty Global Call compatible call control library can be used as a custom library. The Global
Call library supports up to two custom libraries.
GC_CUSTOM2_LIB
The second of two call control library place holders for custom call control libraries. Any
third-party Global Call compatible call control library can be used as a custom library. The
Global Call library supports up to two custom libraries.
GC_DM3CC_LIB
The call control library that controls access to network interfaces on Digital Network Interface
boards. This library is used for call control using ISDN and CAS/R2MF (PDK protocols)
signaling on Digital Network Interface boards.
GC_H3R_LIB
The call control library that controls access to IP network interfaces. This call control library
supports IP H.323 and SIP protocols and is used in conjunction with GC_IPM_LIB.
GC_IPM_LIB
The call control library that provides access to IP media resources. This library is used for
H323/SIP call control signaling and is used in conjunction with GC_H3R_LIB.
1.4.1Starting Call Control Libraries
Call control libraries must be started before they can be used by the Global Call functions. The call
control libraries are started when a gc_Start( ) function is issued. The gc_Start( ) function allows
the selective starting of call control libraries where the application can specify if all the call control
libraries are to be started or only specified libraries are to be started. The application can also start
a custom call control library that is not supported by Global Call. See the Global Call API Library Reference for more information about the gc_Start( ) function.
Note: Invoking gc_Start(NULL) loads all call control libraries and consequently the memory footprint
includes memory that is allocated for all call control libraries. To reduce the memory footprint,
selective loading of call control libraries is recommended. For more information and an example,
see the gc_Start( ) function in the Global Call API Library Reference.
1.4.2Call Control Library States
The initial state of all the call control libraries is the Configured state. When a call control library is
successfully started, the library will be in the Available state. If the call control library fails to start,
the library will be in the Failed state as shown in the diagram below. If the call control library is not
started, it remains in the Configured state.
22Global Call API for HMP on Windows Programming Guide — August 2006
Figure 3. Call Control Library States
CONFIGURED
gc_Start()
Product Description
Start
Successful
AVAILABLEFAILED
Start
Failed
Table 1 describes the different states of a call control library.
Table 1. Call Control Library States
StateDescription
ConfiguredA library that is supported by Global Call is considered a configured library.
AvailableA library that has been successfully started is considered to be available for use by a
Global Call application.
FailedA library that has failed to start is considered to be unavailable for use by a Global Call
application.
Each configured call control library is assigned an ID number by Global Call. Each library also has
a name in an ASCII string format. Library functions perform tasks such as converting a call control
library ID to an ASCII name and vice-versa, determining the configured libraries, determining the
available libraries, determining the libraries started and the libraries that failed to start, and other
library functions.
The following functions are the call control library information functions. All the library functions
are synchronous, thus they return without a termination event.
• gc_CCLibIDToName( )
• gc_CCLibNameToID( )
• gc_CCLibStatusEx( )
• gc_GetVer( )
See the Global Call API Library Reference for detailed information about these functions.
1.5Global Call Object Identifiers
The Global Call API is call-oriented, that is, each call initiated by the application or network is
assigned a Call Reference Number (CRN) for call control and tracking purposes. Call handling is
independent of the line device over which the call is routed. Each line device or device group is
assigned a Line Device Identifier (LDID) that enables the application to address any resource or
Global Call API for HMP on Windows Programming Guide — August 200623
Product Description
group of resources using a single device identifier. Certain features, such as Feature Transparency
and Extension (FTE), Real Time Configuration Management (RTCM), and Global Call Service
Request (GCSR) operate on a basic entity called a Global Call target object. Target objects are
identified by a target type and a target ID.
The following topics provide more detailed information:
• Line Device Identifier
• Call Reference Number
• Object Identifiers and Resource Sharing Across Processes
• Target Objects
1.5.1Line Device Identifier
A Line Device Identifier (LDID) is a unique logical number assigned to a specific resource (for
example, a time slot) or a group of resources within a process by the Global Call library. Minimally,
the LDID number will represent a network resource. For example, both a network resource and a
voice resource are needed to process an R2 MFC dialing function. Using Global Call, a single
LDID number is used by the application (or thread) to represent this combination of resources for
call control.
An LDID number is assigned to represent a physical device(s) or logical device(s) that will handle
a call, such as a network interface resource, when the gc_OpenEx( ) function is called. This
identification number assignment remains valid until the gc_Close( ) function is called to close the
line device.
When an event arrives, the application (or thread) can retrieve the LDID number associated with
the event by using the linedev field of the associated METAEVENT structure. The LDID is
retrieved using the gc_GetMetaEvent( ) or the gc_GetMetaEventEx( ) function.
1.5.2Call Reference Number
A Call Reference Number (CRN) is a means of identifying a call on a specific line device. A CRN
is created by the Global Call library when a call is requested by the application, thread or network.
With the CRN approach, the application (or thread) can access and control the call without any
reference to a specific physical port or line device. CRNs are assigned to both inbound and
outbound calls:
Inbound calls
The CRN is assigned via the gc_WaitCall( ) function. For more information on
gc_WaitCall( ), see the Global Call API Library Reference.
Outbound calls
The CRN is assigned via the gc_MakeCall( ) function. For more information on this function,
see the Global Call API Library Reference.
This CRN has a single LDID associated with it, for example, the line device on which the call was
made. However, a single line device may have multiple CRNs associated with it (that is, more than
24Global Call API for HMP on Windows Programming Guide — August 2006
Product Description
one call may exist on a given line). A line device can have a maximum of 20 CRNs associated with
it. At any given instant, each CRN is a unique number within a process. After a call is terminated
and the gc_ReleaseCallEx( ) function is called to release the resources used for the call, the CRN
is no longer valid.
1.5.3Object Identifiers and Resource Sharing Across Processes
The CRNs and LDIDs assigned by the Global Call API library can not be shared among multiple
processes. These assigned CRNs and LDIDs remain valid only within the process invoked. That is,
for call control purposes, you should not open the same physical device from more than one
process, nor from multiple threads in a Windows environment. Unpredictable results may occur if
this advice is not followed.
1.5.4Target Objects
A target object provides a way of identifying a particular entity that is maintained by a specific
software module. In API function calls, the target object is specified by a pair of parameters, the
target_type and target_ID:
target_type
Identifies the kind of software module and the entity that it maintains. For example, the target
type GCTGT_GCLIB_CHAN represents the Global Call Library and a channel entity that it
maintains.
target_ID
Identifies the specific target object, such as a line device ID (LDID), which is generated by
Global Call at runtime.
Table 2 shows the combinations of physical or logical entities and software module entities that can
make up a target type (target_type).
Table 2. Supported Target Types
Software Module
GCLibSSSS
CCLibSSSS
ProtocolSVSVSV
FirmwareSVSV
S = Supported
SV = Supported with Variances, see the appropriate Global Call Technology Guide for more information.
The possible software modules include:
• GCLib
• CCLib
• Protocol
Entity
SystemNetwork InterfaceChannelCRN
Global Call API for HMP on Windows Programming Guide — August 200625
Product Description
• Firmware
The possible entities include:
System
NIC for IP technology; all physical boards for E1, T1 and ISDN technologies
Network Interface
logical board or virtual board
Channel
time slot
CRN
call reference number
A target type (target_type) name is composed of the prefix, GCTGT, which stands for Global Call
Target, a software module name, such as GCLIB, and an entity name, such as NETIF. For example,
the target type GCTGT_GCLIB_NETIF, indicates that the desired target type is a network interface
maintained by the Global Call library.
A target ID (target_ID) identifies the specific object that is located within the category defined by
the target type (target_type). A target ID can be any of the following:
• line device ID (LDID)
• call reference number (CRN)
• Global Call library ID (GCGV_LIB)
• call control library ID (CCLib ID)
• protocol ID
The types and IDs for target objects are defined at the Global Call level. Table 3 shows the target
types, as described in Table 2, with various target IDs to represent valid target objects.
Table 3. Target Types and Target IDs
Target TypeTarget IDDescription
GCTGT_GCLIB_SYSTEM
GCTGT_CCLIB_SYSTEM †
GCTGT_GCLIB_NETIFGlobal Call Line device ID Network interface target object in Global
GCTGT_CCLIB_NETIFGlobal Call Line device ID Network interface target object in call
GCTGT_GCLIB_CHANGlobal Call Line device ID Channel target object in Global Call library
GCTGT_CCLIB_CHANGlobal Call Line device ID Channel target object in call control library
† For E1, T1 and ISDN technologies only.
‡ Target types that can only be used by functions issued in synchronous mode. If a function uses one of these target types in
asynchronous mode, an error will be generated. The functions that can use these target types are gc_GetConfigData( ) (E1, T1
and ISDN technologies only), gc_SetConfigData( ), gc_ReqService( ), and gc_RespService( ).
‡ CCLib IDCall control library module target object.
Call Library module.
control library module.
module.
module.
26Global Call API for HMP on Windows Programming Guide — August 2006
Table 3. Target Types and Target IDs (Continued)
Target TypeTarget IDDescription
GCTGT_GCLIB_CRNGlobal Call CRNCRN target object in Global Call library
GCTGT_CCLIB_CRNGlobal Call CRNCRN target object in call control library
† For E1, T1 and ISDN technologies only.
‡ Target types that can only be used by functions issued in synchronous mode. If a function uses one of these target types in
asynchronous mode, an error will be generated. The functions that can use these target types are gc_GetConfigData( ) (E1, T1
and ISDN technologies only), gc_SetConfigData( ), gc_ReqService( ), and gc_RespService( ).
Target Object Availability
Except for the GCTGT_GCLIB_SYSTEM target object, all target IDs are generated or assigned by
the Global Call API when the target object is created (for physical targets) or loaded (for software
targets). Table 4 shows when a target object becomes available and when it becomes unavailable,
depending on the target type.
Before the Global Call application can retrieve, update, or query the configuration data of a target
object, it should obtain the target ID as shown in Table 5.
Table 5. Obtaining Target IDs
Target IDProcedure for Obtaining Target ID
GCGV_LIBAfter the call control library has been successfully started (that is, after the
Global Call Line Device ID † After a line device is opened, the CCLib ID and protocol ID (if applicable)
After gc_Start( ) After gc_Stop( )
After a call is created
(gc_MakeCall( ) returns or
GCEV_OFFERED is received)
After gc_OpenEx( ) After gc_Close( )
gc_Start( ) function is called), the target object’s CCLib ID can be obtained by
calling the gc_CCLibNameToID( ) function.
associated with this line device can be obtained by the gc_GetConfigData( )
function with the set ID and parameter ID as (GCSET_CCLIB_INFO,
GCPARM_CCLIB_ID) and (GCSET_PROTOCOL,
GCPARM_PROTOCOL_ID).
After gc_ReleaseCallEx( )
Global Call API for HMP on Windows Programming Guide — August 200627
Product Description
Table 5. Obtaining Target IDs
Target IDProcedure for Obtaining Target ID
Global Call CRNAfter a call target object is created, its target object ID (that is, the Global Call
† For E1, T1 and ISDN technologies only.
CRN) will be an output of the gc_MakeCall( ) function or provided by the
metaevent associated with the GCEV_OFFERED event.
28Global Call API for HMP on Windows Programming Guide — August 2006
2.Programming Models
This chapter describes the programming models supported by Global Call. Topics include:
The Global Call development software supports application development using asynchronous
programming models. By usage, the asynchronous models are often said to use asynchronous
mode. Asynchronous mode programming is introduced briefly in this chapter and described in
more detail in the Standard Runtime Library API Programming Guide.
2.2Asynchronous Mode Programming
Programming in asynchronous mode in Windows is described in the following topics:
• Asynchronous Model Overview
• Asynchronous Model with Event Handlers
• Asynchronous with Windows Callback Model
• Asynchronous with Win32 Synchronization Model
• Extended Asynchronous Programming Model
2
2.2.1Asynchronous Model Overview
Asynchronous mode programming is characterized by the calling thread performing other
processing while a function executes. At completion, the application receives event notification
from the SRL and then the thread continues processing the call on a particular channel.
A function called in the asynchronous mode returns control immediately after the request is passed
to the device driver and allows thread processing to continue. A termination event is returned when
the requested operation completes, thus allowing the Intel Dialogic operation (state machine
processing) to continue.
Caution: In general, when a function is called in asynchronous mode, and an associated termination event
exists, the gc_Close( ) function should not be called until the termination event has been received.
In order to disable gc_WaitCall( ), gc_ResetLineDev( ) should be called. If this is not done, there
are potential race conditions under which the application may crash with a segmentation fault.
Functions may be initiated asynchronously from a single thread and/or the completion
(termination) event can be picked up by the same or a different thread that calls the sr_waitevt( )
Global Call API for HMP on Windows Programming Guide — August 200629
Programming Models
and gc_GetMetaEvent( ) functions. When these functions return with an event, the event
information is stored in the METAEVENT data structure. The event information retrieved
determines the exact event that occurred and is valid until the sr_waitevt( ) and
gc_GetMetaEvent( ) functions are called again.
For Windows environments, the asynchronous models provided for application development also
include:
• asynchronous model with event handlers
• asynchronous with Windows callback
• asynchronous with Win32 synchronization
• extended asynchronous programming
The asynchronous programming models are recommended for more complex applications that
require coordinating multiple tasks. Asynchronous model applications typically run faster than
synchronous models and require lower levels of system resources. Asynchronous models reduce
processor loading because of the reduced number of threads inherent in asynchronous models and
the elimination of scheduling overhead. Asynchronous models use processor resources more
efficiently because multiple channels are handled in a single thread or in a few threads. See
Section 5.1, “General Programming Tips”, on page 77 for details. Of the asynchronous models, the
asynchronous with SRL callback model and the asynchronous with Windows callback model
provide the tightest integration with the Windows message/event mechanism. Asynchronous model
applications are typically more complex than corresponding synchronous model applications due
to a higher level of resource management (that is, the number of channels managed by a thread and
the tracking of completion events) and the development of a state machine.
After the application issues an asynchronous function, the application uses the sr_waitevt( )
function to wait for events on Intel Dialogic devices. All event coding can be accomplished using
switch statements in the main thread. When an event is available, event information may be
retrieved using the gc_GetMetaEvent( ) function. Retrieved event information is valid until the
sr_waitevt( ) function is called again. The asynchronous model does not use event handlers to
process events.
In this model, the SRL handler thread must be initiated by the application by setting the
SR_MODELTYPE value to SR_STASYNC.
2.2.2Asynchronous Model with Event Handlers
The asynchronous with event handlers model uses the sr_enbhdlr( ) function to automatically
create the SRL handler thread. The application does not need to call the sr_waitevt( ) function
since the thread created by the sr_enbhdlr( ) already calls the sr_waitevt( ) function to get events.
Each call to the sr_enbhdlr( ) function allows the Intel Dialogic events to be serviced when the
operating system schedules the SRL handler thread for execution.
Note: The SR_MODELTYPE value must not be set to SR_STASYNC because the SRL handler thread
must be created by the sr_enbhdlr( ) call. The event handler must not call the sr_waitevt( )
function or any synchronous Intel Dialogic function.
30Global Call API for HMP on Windows Programming Guide — August 2006
Loading...
+ 124 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.