Application Note. Running Applications Using Dialogic Global Call Software as Windows Services



Similar documents
Enhanced Diagnostics Improve Performance, Configurability, and Usability

Application Note. Using a Dialogic Media Gateway Series as a PSTN Gateway with an Asterisk IP-PBX Server

Dialogic Global Call API

Dialogic System Release 6.0 PCI for Windows

Application Note. Receiving Analog In-Band CPID with the Dialogic 1000 Media Gateway Series

Video Conferencing Demo Application for Dialogic Multimedia Products

Application Note. Configuring Dialogic Host Media Processing Software Release 3.0 for Windows Software Licenses

Using Dialogic Boards to Enhance Voice Mail/Messaging Applications. Application Note

Intel Dialogic System Release 6.1 CompactPCI for Windows

Application Note. Using Dialogic Boards to Enhance Interactive Voice Response Applications

Choosing a Dialogic Product Option for Creating a PSTN-HMP Interface

Intel NetStructure Host Media Processing Release 2.0 for Windows

SNMP Agent Software for Dialogic Host Media Processing Software

Dialogic Global Call ISDN

This document is intended to provide details on installation and configuration of the DNS.

Application Note. Configuring Dialogic Host Media Processing Software Release 3.1LIN Software Licenses

Application Note. Introduction to Monitoring Use Cases Using Dialogic DSI SS7HD Network Interface Boards

Dialogic Host Media Processing Software Release 3.0WIN

Estimating Trunk Channel Requirements for VoIP Gateways in Unified Communications Deployments

Dialogic Conferencing API

Intel Dialogic System Software for PCI Products on Windows

Dell OptiPlex XE Watchdog Timer

IMPORTANT NOTE. Dialogic Brooktrout SR140 Fax Software with Alcatel OmniPCX Office. Installation and Configuration Integration Note

Guide to Dialogic System Software, Operating Systems, and Dialogic Products

Intel Integrated Native Developer Experience (INDE): IDE Integration for Android*

How Does Fax over IP Work?

Sage HRMS 2014 Sage Employee Self Service Tech Installation Guide for Windows 2003, 2008, and October 2013

Paving the Way to Next Generation Media and Signaling VoIP Gateways

Moxa Device Manager 2.0 User s Guide

Developing Higher Density Solutions with Dialogic Host Media Processing Software

ALTIRIS Notification Connector Configuration Guide

Application Note. Using Ethereal to Debug SIP and RTP on Dialogic Voice over IP (VoIP) Products

Dialogic Brooktrout Fax Service Provider Software

Moxa Device Manager 2.3 User s Manual

IP LAN Dialogic 2000 Media Gateway Series T1/E1 PBX

Application Note. IP Call Logging Using Dialogic HMP Software and a Passive IP Tap

Dialogic Vision VG Media Gateway

Building Conferencing Applications Using Intel NetStructure Host Media Processing Software

Fuse MQ Enterprise Broker Administration Tutorials

Dialogic System Release 6.0 PCI for Windows

Introduction to Cloud Computing

UM1680 User manual. Getting started with STM32F429 Discovery software development tools. Introduction

Universal Serial Bus Implementers Forum EHCI and xhci High-speed Electrical Test Tool Setup Instruction

Safe and Secure Faxing with Dialogic Brooktrout Fax Boards

Intel Storage System SSR212CC Enclosure Management Software Installation Guide For Red Hat* Enterprise Linux

Dialogic SS7 Protocols SCCP Sub-System Monitor (SSM) User Guide. Document Reference U28SSS

IMPORTANT NOTE. Dialogic Brooktrout SR140 Fax Software with T38Fax.com SIP Trunking Service. Installation and Configuration Integration Note

Python for Series 60 Platform

Intel Entry Storage System SS4000-E

PRACTICAL VIDEO SOLUTIONS. ipulse Manager Software. Installation Guide. Software Version 1.0

Intel Active Management Technology with System Defense Feature Quick Start Guide

Printer Driver Installation Manual

VoIP Media Gateway Reference Platform

NCD ThinPATH Load Balancing Startup Guide versions and 2.8.1

ALTIRIS Software Delivery Solution for Windows 6.1 SP3 Product Guide

VeriSign PKI Client Government Edition v 1.5. VeriSign PKI Client Government. VeriSign PKI Client VeriSign, Inc. Government.

NCD ThinPATH Load Balancing Startup Guide

High Availability Setup Guide

Spotlight Management Pack for SCOM

UM0985 User manual. Developing your STM32VLDISCOVERY application using the IAR Embedded Workbench software. Introduction

GE Fanuc Automation CIMPLICITY

Dialogic MSP 1010 Multi-Services Platform Enables Non-Intrusive SS7 Signaling Monitoring

Cloud Identity Management Tool Quick Start Guide

CT Bus Clock Fallback for Linux Operating Systems

Dell Statistica Statistica Enterprise Installation Instructions

Guide to Dialogic System Software, Operating Systems, and Dialogic Products

M24LRxx/CR95HF application software installation guide

Version Provance Technologies, Inc. All rights reserved. Provance Technologies Inc. 85 Bellehumeur Gatineau, Quebec CANADA J8T 8B7

AN3265 Application note

Command Line Interface User Guide for Intel Server Management Software

Installation and Configuration Guide

MDM Mass Configuration Tool User s Manual

NVIDIA CUDA GETTING STARTED GUIDE FOR MICROSOFT WINDOWS

Intel System Event Log (SEL) Viewer Utility

EMC Documentum Repository Services for Microsoft SharePoint

UM1727 User manual. Getting started with STM32 Nucleo board software development tools. Introduction

Claro Deploys SMS-Based Location-Based Service in Central America

Dialogic IMG 1010/1004 Integrated Media Gateway Downgrade System Software

User Document. Adobe Acrobat 7.0 for Microsoft Windows Group Policy Objects and Active Directory

USSD Services for Interactive Mobile Users

Pulse Redundancy. User Guide

AN4108 Application note

Intel System Event Log (SEL) Viewer Utility

Intel System Event Log (SEL) Viewer Utility. User Guide SELViewer Version 10.0 /11.0 December 2012 Document number: G

IBM Connections Plug-In for Microsoft Outlook Installation Help

Telephony Fundamentals

How To Run Powermedia Xms On A Runspace Cloud Server On A Powermedia Media Server On An Ipad Or Ipad (For Free) On A Raspberry Powermedia (For A Powerpress) On An Ubuntu 2.5 (

Self Help Guides. Create a New User in a Domain

Intel Matrix Storage Console

UM1790 User manual. Getting started with STM32L053 discovery kit software development tools. Introduction

INSTALLATION GUIDE. AXIS Camera Station

Bandwidth Optimization Solutions: Building Cost-Effective Backup Protection Networks. Application Note

IDE Integration for Android* Part of the Intel Integrated Native Developer Experience (Intel INDE) 1.5.7

formerly Help Desk Authority Upgrade Guide

EMC RepliStor for Microsoft Windows ERROR MESSAGE AND CODE GUIDE P/N REV A02

Altiris Task Server 6.0 Help

TECHNICAL SUPPORT GUIDE

SIP Trunking: Enabling Wideband Audio for the Enterprise

Transcription:

Application Note Running Applications Using Dialogic Global Call Software as Windows Services

Application Note Running Applications Using Dialogic Global Call Software as Windows Services Executive Summary This application note explains how to control the startup and shutdown of a telephony application using Dialogic Global Call Software from a Windows service. An overall sample architecture is discussed, and descriptions of the processes involved are given. Instructions and code for running the SampleService and Win32App demo programs are provided as well.

Running Applications Using Dialogic Global Call Software as Windows Services Application Note Table of Contents Introduction... 2 Environment... 2 Downloads... 2 Architecture... 2 Service Control Process... 3 Avoiding Simultaneous Shutdown... 4 System Setup, Build, and Execution of Sample Code... 5 Setting up the System... 5 Building the Applications... 6 Running the Applications... 6 Acronyms... 7 For More Information... 7 1

Application Note Running Applications Using Dialogic Global Call Software as Windows Services Introduction There does not appear to be a best method for running a telephony application using Dialogic Global Call Software as a Windows system service. Certain considerations are important to keep in mind to work with the Dialogic Global Call API libraries correctly. For example, incorrect procedures may cause difficulties in shutting down the Dialogic Global Call API libraries. This document discusses a method for avoiding these difficulties. C/C++ code and two Visual C++ projects are included in demo programs to illustrate the method. Environment The hardware and software used in the test environment for the method described in this document consist of the following components: Windows 2000 Professional with Service Pack 4 Microsoft Visual C++ 6.0 with Service Pack 5 Dialogic System Release 6.0 PCI for Windows Dialogic DM/V960A-4T1 Media Board, with a crossover cable connecting the first and second T-1 spans. The board has a 5ESS ISDN firmware load, as distributed in the enhanced voice media load file for the DM3 architecture. Downloads Two demo programs are available for use with this application note: SampleService Win32App These program demos enable you to understand the techniques explained in this document and also provide additional implementation information. See the For More Information section for the current location to download the Zip file containing these demo programs. Architecture A telephony application using Dialogic Global Call Software operates as a process that requires minimal operating system interaction to shut it down. Far fewer complications occur if the shutdown stimulus comes from the application itself through a gc_stop() API call rather than as a shutdown (kill) signal or message from the operating system. To accomplish this, an architecture, such as the one illustrated in Figure 1, can be used for controlling the application from a system service. The service control process for the telephony application functions as an intermediary between the service management console and the telephony application. To control the application from a system service,,install the telephony application as a Win32 service rather than the telephony application itself. Microsoft Services Management Console Service Control Process for Application Using Dialogic Global Call Other Service Processes Telephony Application Using Global Call Figure 1. Architecture for Controlling an Application from a System Service 2

Running Applications Using Dialogic Global Call Software as Windows Services Application Note Service control operations, such as Start, Stop, and Restart, are initiated from the Windows service management console and sent to the service control process. These operations result in actions that start and stop the telephony application, which resides in its own Win32 process. Service Control Process The service control process is shown in Figure 2 and operates as follows: 1. The service control process, in its main Run() method, issues CreateProcess() to start the telephony application using Global Call Software, and its process ID is saved for later use. The service control process then remains in a GetMessage() loop until forced to break out of it. 2. On receiving a SERVICE_CONTROL_STOP message from the management console, the service control process sends a WM_QUIT message to itself using PostMessage(). 3. The GetMessage() loop is exited, and EnumWindows() is called. This system call invokes a handler for each window in the system, including the window running the application using Dialogic Global Call Software. 4. Each handler matches the saved process ID of the application using Dialogic Global Call Software against the ID of the application running in the window. When the correct window is found, shutdown can begin. 5. A message from the Windows operating system in the WM_USER (application-defined) range is sent to the correct window, and the application running in the window interprets this event as a signal to begin shutting down. Handle Messages from Services Management Console CreateProcess (New Global Call Telephony Process) Create New Dialogic Global Call Software Process and Save Its PID Handler Post WM_QUIT GetMessage ( ) Remain in GetMessage Loop until WM_QUIT Posted EnumWindowsProc Handler ( ) EnumWindows ( ) When Match PID of Window with PID of Application Using Dialogic Global Call Software, Send WM_USER Message to Stop Loop over All Windows (Call Handler Invoked for Each Window) Figure 2. Service Control Process 3

Application Note Running Applications Using Dialogic Global Call Software as Windows Services Avoiding Simultaneous Shutdown The Win32App demo program described in this document is a variation on the Dialogic Global Call API demo program, gc_basic_call_model, which is discussed in the Global Call API Demo Guide (see the For More Information section). The gc_basic_call_model application has been modified so that it runs as a Win32 application rather than as a console application, as it did in the original demo. The modification allows the application to receive window manager events, which are used as an Inter-Process Communications (IPC) mechanism. An event is sent from the service control process (SampleService) to the sample application (Win32App) to signal the application using Dialogic Global Call Software to shut itself down cleanly. If the application using Dialogic Global Call Software were a simple console application, this strategy would fail. Sending a WM_CLOSE to the external console process results in a signal that is caught by the application console WinMain Create Dialogic Global Call Software Worker Thread GetMessage ( ) Remain in GetMessage Loop until WM_USER Termination Event Received Interrupted Flag Set Interrupted Flag in gc_basic_call_model gc_basic_call_model demo application GetExitCodeThread ( ) Wait until gc_basic_thread Shuts Down Telephony Channels, Stops Dialogic Global Call Software, and Exits Demo Application Runs until Interrupted Flag Set Exit Process Figure 3. gc_basic_call_model as a Win32 Application 4

Running Applications Using Dialogic Global Call Software as Windows Services Application Note control handler set by SetConsoleCtrlHandler(). The shutdown process would begin, but a problematic interaction with the underlying Dialogic Global Call API libraries would occur. The console would direct the Dialogic Global Call API libraries to shut down, but there would be no coordination between the console shutting down the libraries and the application also shutting down the libraries with gc_stop(). The likely result would be a hang in the execution of the gc_stop() function. To avoid simultaneous shutdown activities and the resulting instability, the event that initiates the shutdown must exist in the normal operating-system-to-application-event range. If this technique is used, signaling is strictly between the two processes, and will not have undesirable effects. A Windows manager event value of WM_USER + 1, #defined as SERVICE_TERMINATION in both applications, accomplishes this. An illustration of how gc_basic_call_model operates when Win32 is used is shown in Figure 3. The main() function in gc_basic_call_model is replaced by a WinMain()with changes to threading and signaling. The result is: 1. A worker thread that encapsulates the normal gc_basic_call_model is spawned using CreateThread(). 2. A GetMessage() loop is entered, and WinMain() remains there, checking messages received until it sees the termination message sent from the service control process. 3. An interrupt-received flag, monitored by the gc_basic_call_model thread, is set. Gc_basic_call_model then enters its shutdown sequence, closing individual channels and devices, and finally issuing a gc_stop(). 4. While the gc_basic_call_model thread is shutting down, its exit status is monitored in WinMain() until the thread is no longer active. 5. When WinMain() exits, the entire process ends. For more information, refer to the Win32App and SampleService demo programs. Using an application-defined shutdown signal passed between the service and telephony processes can be accomplished by using IPC mechanisms other than the one shown in this application note. Other possibilities include shared memory, system semaphores, and named pipes. System Setup, Build, and Execution of Sample Code To execute the SampleService and Win32App sample programs, complete several tasks, including setting up the system, performing a build, and running the sample code. Note: Although the demo discussed in this application note uses Dialogic DM3 Media Boards and System Release 6.0 PCI for Windows, it is understood that the programming, Windows system services setup, and usage are applicable to the Dialogic HMP Software-based Windows system as well. Setting up the System The basic system setup consists of the following: 1. Install one of the Windows operating systems supported by Dialogic System Release 6.0 PCI for Windows. 2. Install System Release 6.0 PCI for Windows. 3. Install a Dialogic DM/V480A-2T1 Media Board (supports T-1) or Dialogic DM/V960A-4T1 Media Board (supports T-1) with a back-to-back crossover cable (RJ-48-C terminated cable where pin 1 connects to pin 4, pin 2 connects to pin 5) between spans one and two. 4. Configure the installed Dialogic board using the Dialogic Configuration Manager (DCM), selecting the ml2_dsa_5ess (DM/V480-2T1) or ml2_qsa_5ess (DM/V960-4T1) as the media load for the FCD/PCD files. Note that the files themselves are usually located in the C:\Program Files\Dialogic\data directory. 5. In the.config file that corresponds to the.pcd and.fcd files, locate the sections marked [CCS.1] and [CCS.2]. Parameter 0x17 is set to 0 in both, indicating that the ISDN spans operate in User (TE) mode, and expect a Network (NT) connection on their other end. Set one of the spans to Network mode, and the remains in User mode as follows: 5

Application Note Running Applications Using Dialogic Global Call Software as Windows Services [CCS.1] Setparm=0x17,0 NETWORK 0=USER.. [CCS.2] Setparm=0x17,1 NETWORK 0=USER.. # Network Mode.1= # Network Mode.1= Note: For Windows operating systems, the FCD file is automatically created when the PCD file and modified CONFIG file are downloaded to the board. 7. Start the system using DCM. Building the Applications Microsoft Visual C++ 6.0 is used to build both SampleService and Win32App. Workspace and project files (.dsw and.dsp) are provided for each application. Begin by building Win32App in Visual C++ 6.0. Next, compile SampleService. Before doing so, set the two #defines at the top of the source file to appropriate values: #define GCAPP_COMMAND_LINE The full path to the executable (for example, C:\\AppnoteExamples\\Win32App\\Debug\\Win32 App.exe ). Note that double backward slashes are used. #define GCAPP_DIRECTORY The full path to the directory in which the gc_basic_call_model.cfg (.config file) can be found (for example, C:\\AppnoteExamples\\Win32App ). Running the Applications Once SampleService is built, install it into the Windows service manager by executing SampleService - Service in its Debug directory. When the service manager is started, SampleService appears in the service listing. SampleService can be uninstalled by executing SampleService -UnregServer. A visible window on the desktop is needed to run the application using Dialogic Global Call Software. Configure the window by doing the following: 1. Open the service manager. 2. Double click on SampleService. 3. Go to the Log On tab. 4. Check off Allow service to interact with desktop. 5. Select OK to save. Now start SampleService from the service manager by right clicking on the SampleService line and selecting Start. A window running Win32App appears. Two ISDN channels running back-to-back are configured, and the counters indicating the number of inbound and outbound calls handled increment as calls are made. The normal log information detail produced by gc_basic_call_model is available in the log files in the same directory as the gc_basic_call_model.cfg file. Problems in starting Win32App from SampleService can be diagnosed from errors and events that appear in the application log in the system event viewer. To stop SampleService from the service manager, right click on the SampleService line and select Stop. The Win32App window displays a stopping message, and then disappears. A clean exit should be noted in the inbound and outbound log files. 6

Running Applications Using Dialogic Global Call Software as Windows Services Application Note Acronyms DCM Dialogic Configuration Manager FCD Feature Configuration Description HMP Host Media Processing IPC Inter-Process Communication For More Information A Zip file containing the SampleService and Win32App demo programs can be downloaded at http://www.dialogic.com/goto/?10684 Dialogic System Release 6.0 PCI for Windows http://www.dialogic.com/manuals/sr60winpci/ PCD Product Configuration Manager Dialogic DM/V480A-2T1 Media Boards, Dialogic DM/V600A-2E1 Media Boards, Dialogic DM/V960A- 4T1 Media Boards, Dialogic DM/V1200A-4E1 Media Boards http://www.dialogic.com/products/ tdm_boards/media_processing/ Global Call API Demo Guide http://www.dialogic.com/manuals/docs/ globalcall_demo_v2.pdf 7

To learn more, visit our site on the World Wide Web at http://www.dialogic.com. Dialogic Corporation 9800 Cavendish Blvd., 5th floor Montreal, Quebec CANADA H4M 2V9 INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH PRODUCTS OF DIALOGIC CORPORATION OR ITS SUBSIDIARIES ( DIALOGIC ). 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. Dialogic may make changes to specifications, product descriptions, and plans at any time, without notice. Dialogic is a registered trademark of Dialogic Corporation. 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. Microsoft, Windows, and Visual C++ are a 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. Dialogic encourages all users of its products to procure all necessary intellectual property licenses required to implement their concepts or applications, which licenses may vary from country to country. Copyright 2007 Dialogic Corporation All rights reserved. 10/07 9336-02 www.dialogic.com