Telephony Application Using Tapi 2.1

From PresenceWiki
Revision as of 13:53, 4 August 2011 by Graham (Talk | contribs)

Jump to: navigation, search
Tutorial Pages > Telephony Application Using Tapi 2.1


Overview

This document describes the processes needed to interact with a telephony system that uses Tapi 2.1.

The aim is to be able to make calls from a users phone via a click on a form.

We also need to be able to monitor the call length, drop the call and record it's status.

In the case of a system using Tapi 3.0 we can uses the JTAPI solution that is built into Presence.

For Tapi 2.1, we need to call programs written in c++ to make and query calls, Namely Caller.exe and Status.exe.

In this solution we have 2 servers.

One server that runs the main Presence installation and makes socket requests via the socket node to the Tapi Server.

The Tapi Server is in this case an NT machine, that is running a telephony service along with Presence.

Tasks running on the Tapi Server have socket nodes listening for requests that then make calls to the two exes via the Call Native Program Node.

The main presence server makes requests over sockets to a presence tapi server located on an NT machine.

A Caller Program is then run on the NT Server for each Call request. When the Call is terminated (eg user hungup), a file is populated with the call duration. This file is then picked up by Presence on the NT Server, which then populates the timers table in sqlserver.

A Status Program can also be run on the NT Server, to either drop or return the status of a call.

TAPI Provider

This document describes the processes needed to interact with a telephony system that uses Tapi 2.1.

The aim is to be able to make calls from a users phone via a click on a form.

http://www.international-presence.com/images/docs/tapi2/norstar.png

http://www.international-presence.com/images/docs/tapi2/norstarcontrolpanel.png

http://www.international-presence.com/images/docs/tapi2/norstarconfig.png

We also need to be able to monitor the call length, drop the call and record it's status.

In the case of a system using Tapi 3.0 we can uses the JTAPI solution that is built into Presence.

For Tapi 2.1, we need to call programs written in c++ to make and query calls, Namely Caller.exe and Status.exe.

In this solution we have 2 servers.

One server that runs the main Presence installation and makes socket requests via the socket node to the Tapi Server.

The Tapi Server is in this case an NT machine, that is running a telephony service along with Presence.

Tasks running on the Tapi Server have socket nodes listening for requests that then make calls to the two exes via the Call Native Program Node.


Caller.exe

Caller.exe runs on the Tapi Server and is located in the c:\Presence\Caller

The sub directories of this are:-

Log - which contains individual logs for each device.

Com - This contains a file for each call denoting the call length.

Parameters passed are "EventName","UserID","CaseID","From","To" eg "pcpgrtest","22","213443","3719","9011442089721390"

Note, Only one Caller.exe can be run at any one time for a device.

So if a Caller.exe runs for device 3719 say when a Caller.exe is already running for that device then the currently running Caller.exe will be terminated to allow for the new Caller.exe.

Status.exe

Status.exe runs on the Tapi Server and is located in the c:\Presence\Status

The sub directories of this are:-

Log - which contains individual logs for each device.

Com - This contains a file for each call denoting the last updated Status.

Parameters passed are "Device","Action" where action can be "drop" or "status" eg "3719","drop"

Note, Only one Status.exe can be run at any one time for a device.

So if a Status.exe runs for device 3719 say when a Status.exe is already running for that device then the currently running Status.exe will be terminated to allow for the new Status.exe.

Description of Tasks On Tapi Server

Simple Task To Confirm Action is the example task that shows you how to use Check Login Sub Task in your OnDemand tasks.

This task is our OnDemand task, that contains the Check Login Sub Task. As such it must be added to the OnDemand Queue:-

http://www.international-presence.com/images/docs/tapi2/tapiservertasks.png

Instructions task explains how to configure the tasks.

The instructions task must be run once to create the DEMO.UserLogin table:-

http://www.international-presence.com/images/docs/tapi2/socketreceive.png

It is this table that the other tasks use to store and retrieve data about who is logged in.

Session Expiry is a queued task that querys the Demo.UserLogin table effectively expiring sessions unused for 20 minutes.

This task must be added to the Task Queue.

http://www.international-presence.com/images/docs/userlogin/queued.png

Check Login Sub Task calls Login and updates the users details in the Demo.USerLogin table.

Login querys the username and password against the system and either returns a null response or a login panel.

Check User Exists in LDAP performs an LDAP Query against your active directory to Query if the username exists.

Description of Tasks On Presence Server

Simple Task To Confirm Action is the example task that shows you how to use Check Login Sub Task in your OnDemand tasks.

This task is our OnDemand task, that contains the Check Login Sub Task. As such it must be added to the OnDemand Queue:-

http://www.international-presence.com/images/docs/tapi2/presenceservertasks.png

Instructions task explains how to configure the tasks.

The instructions task must be run once to create the DEMO.UserLogin table:-

http://www.international-presence.com/images/docs/tapi2/socketsend.png

It is this table that the other tasks use to store and retrieve data about who is logged in.

Session Expiry is a queued task that querys the Demo.UserLogin table effectively expiring sessions unused for 20 minutes.

This task must be added to the Task Queue.

http://www.international-presence.com/images/docs/userlogin/queued.png

Check Login Sub Task calls Login and updates the users details in the Demo.USerLogin table.

Login querys the username and password against the system and either returns a null response or a login panel.

Check User Exists in LDAP performs an LDAP Query against your active directory to Query if the username exists.

In Use

Start the httpserver and go to http://localhost/task/newconfirmtask

The first time you should see the following:-

http://www.international-presence.com/images/docs/tapi2/examplecallformtask.png

This will require a valid windows username and password combination:-

http://www.international-presence.com/images/docs/userlogin/pleaseenterapassword.png

If the password is incorrect then you will get the following:-

http://www.international-presence.com/images/docs/userlogin/usernamepasswordincorrect.png

The username is looked up via an LDAP Query, so if it does not exist you will see:-

http://www.international-presence.com/images/docs/tapi2/form.png

As the task validates that the http session is logged in, Once the user is logged in they will stay logged in.

This means that once the username and password have been successfully entered, subsequent visits to http://localhost/task/newconfirmtask will pass straight through to the rest of the OnDemand page.