Difference between revisions of "Telephony Application Using Tapi 2.1"

From PresenceWiki
Jump to: navigation, search
Line 84: Line 84:
 
<h2>Description of Tasks On The Tapi Presence Server</h2>
 
<h2>Description of Tasks On The Tapi Presence Server</h2>
  
<b>Simple Task To Confirm Action</b> is the example task that shows you how to use <b>Check Login Sub Task</b> in your OnDemand tasks.
+
http://www.international-presence.com/images/docs/tapi2/tapiservertasks.png
  
“Tapi - Live - Insert Into Timers Table” Scans files in the Caller com folders and inserts their values into the sql table  
+
<b>Insert Into Timers Table</b> Scans files in the Caller com folders and inserts their values into the sql table  
“Tapi - Live - Run Caller Program” Socket listen for request to run Caller Program
+
“Tapi - Live - Run Status Program” Socket listen for request to run Status Program
+
  
“Tapi - Test - Test Caller Program” Allows simple testing of Caller Program
+
<b>Run Caller Program</b> Socket listen for request to run Caller Program  
“Tapi - Test - Test Status Program” Allows simple testing of Status Program
+
  
 +
<b>Run Status Program</b> Socket listen for request to run Status Program
  
This task is our OnDemand task, that contains the <b>Check Login Sub Task</b>. As such it must be added to the OnDemand Queue:-
+
<b>Test Caller Program</b> Allows simple testing of Caller Program
  
http://www.international-presence.com/images/docs/tapi2/tapiservertasks.png
+
<b>Test Status Program</b> Allows simple testing of Status Program
  
<b>Instructions</b> 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
 
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.
 
  
<b>Session Expiry</b> 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
 
http://www.international-presence.com/images/docs/userlogin/queued.png
 
<b>Check Login Sub Task</b> calls Login and updates the users details in the Demo.USerLogin table.
 
 
<b>Login</b> querys the username and password against the system and either returns a null response or a login panel.
 
 
<b>Check User Exists in LDAP</b> performs an LDAP Query against your active directory to Query if the username exists.
 
  
 
<h2>Description of Tasks On The Main Presence Server</h2>
 
<h2>Description of Tasks On The Main Presence Server</h2>

Revision as of 14:13, 4 August 2011

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 current status.

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 there are 2 Presence Servers that communicate via the Presence Socket Node:-

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

The Tapi Presence Server is an NT machine, that is running a Telephony service along with Presence.

Tasks running on the Tapi Presence 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 the Presence Tapi Server.

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

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

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

TAPI Provider

For the system to work Tapi has to first be configured on the Tapi Presence Server.

This solution uses the Norstar TSP, which once installed, can be accessed through Control Panel - Phone And Mode Options.

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

Press configure for more details.

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

For each physical device we need to add an extra station first aquiring an additional license.

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

You can test that the TSP is working by running the Norstar Personal Call Manager which enables you to make calls on a device.

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 details and length.

Parameters passed are "EventName","UserID","CaseID","From","To" eg "pcpgrtest","22","433765" ,"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 device 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 The Tapi Presence Server

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

Insert Into Timers Table Scans files in the Caller com folders and inserts their values into the sql table

Run Caller Program Socket listen for request to run Caller Program

Run Status Program Socket listen for request to run Status Program

Test Caller Program Allows simple testing of Caller Program

Test Status Program Allows simple testing of Status Program


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


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

Description of Tasks On The Main Presence Server

“Tapi - Select From Timers Table” - Query to get the call info “Tapi - Make A Call” - Task to launch caller program via socket request. “Tapi - Query A Status” - Task to launch Status program with “Status” Parameter via socket request. “Tapi - Drop A Call” - Task to launch Status program with “Drop” Parameter via socket request. “Tapi - Example Call Form” – On Demand Task that calls Make/Query/Drop tasks and displays results.


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.