ivrSVR / CTI Server for Avaya

Posted: July 10, 2014 in TSAPI

Introduction

The ivrSVR is a CTI server for IVR systems and agent front end applications. The ivrSVR is part of my CTI Architecture, it uses TSAPI library to monitor IVR and agent extensions, it hides the technical details of TSAPI and provide simple ActiveX, REST and WebSocket interfaces for the development of IVR systems and front end applications. The ivrSVR program supports passing of customized user data between different kind of CTI software when a customized DLL is developed. Currently, the ivrSVR program supports the following call control functions:

  • ACD Login – Login ACD
  • ACD Logout – Logut ACD
  • ACD SetState – Set AUX, ACW, MANUAL or AUTO mode
  • MakeCall – Make a call
  • Answer – Answer a call
  • Hangup – Hangup a call
  • DropParty – drop specific party from a call
  • Hold – Hold a call
  • Retrieve – Retrieve a call
  • Transfer – Single step or two steps transfer which depends on extension state
  • Conference – Single step or two steps conference which depends on extension state
  • Consultation – Make a consultation call
  • Reconnect – Reconnect from a consultation call
  • Alternate – Alternate a hold and a connected call
  • SingleStepConference – Join a new device into an existing call
  • SelectiveListeningHold – prevent a specific party on a call from hearing anything said by another specific party or all other parties on the call
  • SelectiveListeningRetrieve – retrieve a party from listen-hold to another party or all parties that were previously being listen-held
  • DTMF – Send a DTMF tone or a string of DTMF tones
  • UserData – Get user data when for call alert or hangup
  • ClearCall – Clear a call or all calls of an extension
  • DeflectCall – Redirects an alerting call at a device with the connection to a new destination, either on-PBX or off-PBX
  • PickupCall – Redirects an alerting call at a device to another on-PBX device
  • Snapshot – Snapshot a device
  • QueryACDSplit – Query ACD split and provides number of available agents, number of calls in queue and number of logon agents
  • QueryAgentLogin – Query the extension of each ACD agent logged into the specified ACD split
  • QueryAgentState – Query the agent state of an ACD agent
  • QueryCallClassifier – Query the number of “idle” and “in-use” ports of call classifier cards
  • QueryTimeOfDay – Query the switch information for the year, month, day, hour, minute, and second
  • QueryDeviceName -Query the associated name of the device
  • QueryDoNotDisturb – Query the status of the send all calls feature expressed as on or off at a device
  • QueryDeviceInfo – Query the class and type of a device
  • QueryForwarding – Query the associated name of the device
  • QueryMsgWaitingInd – Query status of the message waiting indicator expressed as on or off for a device
  • QueryStationStatus – Query the idle and/or busy state of a station
  • QueryTrunkGroup – Query the number of idle trunks and the number of in-use trunks
  • QueryUCID – Query the Universal Call ID (UCID) for a normal callID
  • SetDoNotDisturb – Turns on or off the G3 Send All Calls (SAC) feature for a user station
  • SetForwarding – Sets the G3 Call Forwarding feature on or off for a user station
  • SetMsgWaitingInd – Sets the G3 Message Waiting Indicator (MWI) on or off for a user station

Release 

1 May 2016, ivrSVR 1.1.9 just released. This version included the following updates:

1. The Answer() API supports answer call by callid.
2. The Retrieve() API supports retrieve call by callid.
3. The ClearCall() API supports clear call by callid.
4. New API SingleStepConference() is supported.
5. New admin command “bulkadd extension” and “bulkdelete extension” are supported via tcpgate console.
6. The MakeCall() API returns additonal UCID field to application.
7. The Consultation() API returns additional UCID field to application.

25 Mar 2016, ivrSVR 1.1.8 just released. This version supports additional CTI functions

  • QueryDeviceInfo
  • DeflectCall
  • PickupCall
  • QueryAgentLogin
  • QueryAgentState
  • QueryCallClassifier
  • QueryDeviceName
  • QueryDoNotDisturb
  • QueryForwarding
  • QueryMsgWaitingInd
  • QueryStationStatus
  • QueryTimeOfDay
  • QueryTrunkGroup
  • QueryUCID
  • SetDoNotDisturb
  • SetForwarding
  • SetMsgWaitingInd

Preparation and Password Encryption

  • The access MDB file stored the the username and password of AE server. For security reason, a tool called encryptpasswd.exe is provided to generate an encrypted password for the installation and configuration of the software
  • Execute the program, generate an encrypted passwords for the user of AE server, then paste the encrypted password to parameter ivr_tlink. For example, the encrypted password for “p@ssword” is “R3NIw1yJMLlnPFzEQtuh2A==”
  • encryptpasswd

64 bit Windows System 

  • For 64 bit Windows system, please follow the steps below
    • Download and install the Microsoft Visual C++ 2008 Service Pack 1 Redistributable Package MFC Security Update http://www.microsoft.com/en-hk/download/details.aspx?id=26368, select the x86 version
    • Configure ODBC System DSN using
    • C:\Windows\SysWOW64\odbcad32.exe
    • Stop the Windows firewall because it enables by default and I don’t have time to figure out what ports are required to open, you need to find them out by yourself.

 Installation

  • Download the TSAPI client for Windows 32-bit from Avaya web site, it contains the library files. DevConnect registration is required before you can access the download page.
  • Download the ivrSVR zip file here or backup site.
  • Follow the installation steps below to install the software.
    • Extract all the files into directory c:\program files\ivrSVR
    • Open Windows Command Prompt, enter the following commands to register the program as Windows Service
      • cd c:\program files\ivrSVR
      • ivrSVR -i
    • Open ODBC Setting, create a System DSN called IVRSVRCFG for Microsoft Access Driver and point to ivrsvr.mdb which is located in the directory c:\program files\ivrSVR
    • Open the Access file, edit the value of parameters ivr_tlink_01 and ivr_tlink_02 to the TLINK of your AES servers in the tParameter table
    • Start the Windows Service ivrSVR
    • Telnet to localhost and port number 14012, enter username tcpgate and password tcpgate01 to access the program console
    • Enter the following command in the program console, you will receive debug information
      • trace on asc
    • Enter the following command in the program console, you will get the help message
      • help
    • To support passing of user data between applications, please install uuiSVR which is described in ScreenPop page. Then modify the ivr_uuisvr parameter to have the IP address and port number of the uuiSVR.

Load Balance and Redundant Configuration

loadbalancereddundancy

  • The ivrSVR is designed as a stateless CTI server especially the REST interface which has no fixed connection between the clients and servers.
  • You can use Linux Virtual Servers to form a Virtual IP (VIP) for ivrSVR instances. If you configure the LVS as round robin, then load balance of ivrSVR can be implemented very easily.
  • If one of the ivrSVR server instance is failure, LVS can detect it and route the subsequent traffic to other healthy ivrSVR instances.
  • If you want to remove a particular ivrSVR instance from the LVS, you can do it very easily by the following tcpgate console command
    • add blacklist 10.10.1.231 activeLVS
      • Hint: this adds the active LVS as blacklist IP address to ivrSVR, the polling messages from the LVS will not be entertained and LVS will remove the ivrSVR from the connection pool.
    • delete blacklist 10.10.1.231
      • Hint: After maintenance, please remove the blacklist so LVS polling messages will be entertained and LVS will add the ivrSVR to the connection pool.

Customized DLL for Passing of User Data 

  • Edit the parameters to enable passing of user data. A customized DLL is used to set or get of user data from UUI key
    • ivr_custdataconfigstring, the configuration string of your customized DLL
    • ivr_custdatadll, the path and name of the DLL
    • ivr_custdatamaxsize, the maximum size of user data

ActiveX

  • Register the ActiveX control ctiClient.ocx by the following Windows command
    • regsvr32 ctiClient.ocx

REST interface 

Installation for WebSocket interface Call Control

  • Enter the following command in the program console to add a WebSocket interface port
    • add tcp 9001 * * custom ivrsvrws
  • WebSocket interface accepts JSON request, returns JSON response and delivers unsolicited JSON events
  • The JSON strings for MakeCall request and response are
    • {id: “1”, request: “makecall”, extension: “101”, destination: “67896789”, data: “hello world”}
    • {msgtype: “response”, id: “1”, result: “success”, callid: “12345”, ucid: “00001148011456795778”}
  • The JSON strings for Hold call request and response are
    •  {id: “2”, request: “hold”, extension: “101”}
    • {msgtype: “response”, id: “2”, result: “success”, error: “”}
  • The JSON strings for Retrieve call request and response are
    • {id: “3”, request: “retrieve”, extension: “101”}
    • {id: “3”, request: “retrieve”,, extension: “101”, destination: “T1234#1”}
    • {msgtype: “response”, id: “3”, result: “success”, error: “”}
  • The JSON strings for Hangup call request and response are
    • {id: “4”, request: “hangup”, extension: “101”, data: “hello world”}
    • {msgtype: “response”, id: “4”, result: “success”, error: “”}
  • The JSON strings for DropParty call request and response are
    • {id: “4”, request: “dropparty”, extension: “101”, party: “60123”, data: “hello world”}
    • {msgtype: “response”, id: “4”, result: “success”, error: “”}
  • The JSON strings for Answer call request and response are
    • {id: “5”, request: “answer”,extension: “101”, destination: “67896789”}
    • {msgtype: “response”, id: “5”, result: “success”, callid: “12345”}
  • The JSON strings for Consultation call request and response are
    • {id: “6”, request: “consultation”,extension: “101”, destination: “67896789”, data: “hello world”}
    • {msgtype: “response”, id: “6”, result: “success”, primarycallid: “123”, secondarycallid: “456”, ucid: “00001148011456795778”}
  • The JSON strings for Reconnect call request and response are
    • {id: “7”, request: “reconnect”, extension: “101” }
    • {msgtype: “response”, id: “7”, result: “success”, error: “”}
  • The JSON strings for Alternate call request and response are
    • {id: “8”, request: “alternate”, extension: “101”}
    • {msgtype: “response”, id: “8”, result: “success”, error: “”}
  • The JSON strings for Transfer call request and response are
    • {id: “9”, request: “transfer”, extension: “101”, destination: “67896789”}
    • {msgtype: “response”, id: “9”, result: “success”, error: “”}
  • The JSON strings for Conference call request and response are
    • {id: “10”, request: “conference”, extension: “101”, destination: “67896789”}
    • {msgtype: “response”, id: “10”, result: “success”, error: “”}
  • The JSON strings to send DTMF request and response are
    • {id: “11”, request: “dtmf”, extension: “101”, dtmf: “1”}
    • {msgtype: “response”, id: “11”, result: “success”, error: “”}
  • The JSON strings for ACD Login request and response are
    • {id: “12”, request: “login”, extension: “101”, agentid: “12345”, passwd:”67890″}
    • {msgtype: “response”, id: “12”, result: “success”, error: “”}
  • The JSON strings for ACD Logout request and response are
    • {id: “13”, request: “logout”, extension: “101”, agentid: “12345”, passwd:”67890″}
    • {msgtype: “response”, id: “13”, result: “success”, error: “”}
  • The JSON strings for ACD SetState request and response are
    • {id: “14”, request: “setstate”, extension: “101”, state: “aux”, reasoncode:”1″}
    • {id: “14”, request: “setstate”, extension: “101”, state: “acw”}
    • {id: “14”, request: “setstate”, extension: “101”, state: “manual”}
    • {id: “14”, request: “setstate”, extension: “101”, state: “auto”}
    • {msgtype: “response”, id: “14”, result: “success”, error: “”}
  • The JSON strings for StartMonitor extension
    • {id: “15”, request: “startmonitor”, extension: “101”}
    • {msgtype: “response”, id: “15”, result: “success”, error: “”}
  • The JSON strings for StopMonitor extension
    • {id: “16”, request: “stopmonitor”, extension: “101”}
    • {msgtype: “response”, id: “16”, result: “success”, error: “”}
  • The JSON strings for Alert UserData request and response are
    • {id: “17”, request: “userdata”, extension: “101”, type: “alert”}
    • {“msgtype”: “response”, “id”: “17”, “result”: “success”, “callid”: 1361, “calling”: “101”, “called”: “102”, “alerting”: “102”, “cli”: “101”, “dnis”: “102”, “uec”: “”, “ucid”: “00001013551428290972”, “split”: “”, “trunkgroup”: “5”, “trunkmember”: “20”, “userdata”: “”}
  • The JSON strings for Hangup UserData request and response are
    • {id: “18”, request: “userdata”, extension: “101”, type: “hangup”}
    • {“msgtype”: “response”, “id”: “18”, “result”: “success”, “callid”: 1361, “releasing”: “101”, “ucid”: “00001013551428290972”, “userdata”: “”}
  • The JSON strings for Get, Set and Update UserData requests are
    • {id: “18”, request: “userdata”, extension: “101”, type: “get”, uui: “FCCCCCCC0000000156A853617F00000113EC00000005”}
    • {“msgtype”: “response”, “id”: “18”, “result”: “success”, “data”: “get data”}
    • {id: “18”, request: “userdata”, extension: “101”, type: “set”, data: “set data”}
    • {“msgtype”: “response”, “id”: “18”, “result”: “success”, “uui”: “FCCCCCCC0000000156A853617F00000113EC00000005”}
    • {id: “18”, request: “userdata”, extension: “101”, type: “update”, uui: “FCCCCCCC0000000156A853617F00000113EC00000005”, data: “upate data”}
    • {“msgtype”: “response”, “id”: “18”, “result”: “success”, “error”: “”}
  • The JSON strings for ClearCall request and response are
    • {id: “19”, request: “clearcall”, extension: “101”, destination: “102”}
    • {msgtype: “response”, id: “19”, result: “success”, error: “”}
  • The JSON strings for DeflectCall request and response are
    • {id: “20”, request: “deflectcall”, extension: “101”, destination: “102”}
    • {msgtype: “response”, id: “20”, result: “success”, error: “”}
  • The JSON strings for PickupCall request and response are
    • {id: “21”, request: “pickupcall”, extension: “101”, destination: “102”}
    • {msgtype: “response”, id: “21”, result: “success”, error: “”}
  • The JSON strings for Snapshot request and response are
    • {id: “22”, request: “snapshot”, extension: “101”}
    • {“msgtype”: “response”, “id”: “22”, “result”: “success”, “error”: “”, “extension”: “101”, “numcall”: 1, “list”: [{“callid”: 13815, “state”: “connect”, “numparty”: 2, “party”: [{“extension”: “101”}, {“extension”: “T13815#2”}]}]}
  • The JSON strings for SingleStepConference request and response are
    • {id: “22”, request: “singlestepconference”, extension: “101”, devicetojoin: “102”, type: “passive”}
    • {msgtype: “response”, id: “22”, result: “success”, callid: “12345”, ucid: “00001000481428289124”}
  • The JSON strings for SelectiveListeningHold request and response are
    • {id: “22”, request: “selectivelisteninghold”, extension: “101”, party: “102”}
    • {id: “22”, request: “selectivelisteninghold”, extension: “101”, party: “all”}
    • {msgtype: “response”, id: “22”, result: “success”}
  • The JSON strings for SelectiveListeningRetrieve request and response are
    • {id: “22”, request: “selectivelisteningretrieve”, extension: “101”, party: “102”}
    • {id: “22”, request: “selectivelisteningretrieve”, extension: “101”, party: “all”}
    • {msgtype: “response”, id: “22”, result: “success”}
  • The JSON strings for QueryACDSplit request and response are
    • {id: “23”, request: “queryacdsplit”, split: “201”}
    • {“msgtype”: “response”, “id”: “23”, “result”: “success”, “agentsavailable”: 5, “callsqueue”: 0, “agentslogon”: 26}
  • The JSON strings for QueryAgentLogin request and response are
    • {id: “24”, request: “queryagentlogin”, split: “201”}
    • {“msgtype”: “response”, “id”: “24”, “result”: “success”, “split”: “201”, “numextension”: 5, “list”: [{“extension”: “101”}, {“extension”: “102”}, {“extension”: “103”}, {“extension”: “104”}, {“extension”: “105”}]}
  • The JSON strings for QueryAgentState request and response are
    • {id: “25”, request: “queryagentstate”, extension: “101”}
    • {“msgtype”: “response”, “id”: “25”, “result”: “success”, “skillmode”: “null”, “talkstate”: “idle”, “reasoncode”: 0}
  • The JSON string for QueryCallClassifier request and response are
    • {id: “26”, request: “querycallclassifier”}
    • {“msgtype”: “response”, “id”: “26”, “result”: “success”, “availport”: 439, “usedport”: 5}
  • The JSON string for QueryTimeOfDay request and response are
    • {id: “27”, request: “querytimeofday”}
    • {“msgtype”: “response”, “id”: “27”, “result”: “success”, “year”: 16, “month”: 3, “day”: 23, “hour”: 22, “minute”: 24, “second”: 16}
  • The JSON string for QueryDeviceName request and response are
    • {id: “28”, request: “querydevicename”, extension: “101”}
    • {“msgtype”: “response”, “id”: “28”, “result”: “success”, “name”: “Peter”}
  • The JSON string for QueryDoNotDisturb request and response are
    • {id: “29”, request: “querydonotdisturb”, extension: “101”}
    • {“msgtype”: “response”, “id”: “29”, “result”: “success”, “dnd”: “false”}
  • The JSON string for QueryDeviceInfo request and response are
    • {id: “30”, request: “querydeviceinfo”, extension: “101”}
    • {“msgtype”: “response”, “id”: “30”, “result”: “success”, “associatedclass”: “other”, “associateddevice”: “”}
  • The JSON string for QueryForwarding request and response are
    • {id: “31”, request: “queryforwarding”, extension: “101”}
    • {“msgtype”: “response”, “id”: “31”, “result”: “success”, “destination”: “102”}
  • The JSON string for QueryMsgWaitingInd request and response are
    • {id: “32”, request: “querymsgwaitingind”, extension: “101”}
    • {“msgtype”: “response”, “id”: “32”, “result”: “success”, “indicator”: “false”}
  • The JSON string for QueryStationStatus request and response are
    • {id: “33”, request: “querystationstatus”, extension: “101”}
    • {“msgtype”: “response”, “id”: “33”, “result”: “success”, “busy”: “false”}
  • The JSON string for QueryTrunkGroup request and response are
    • {id: “34”, request: “querytrunkgroup”, tag: “410”}
    • {“msgtype”: “response”, “id”: “34”, “result”: “success”, “idletrunks”: 91, “usedtrunks”: 1}
  • The JSON string for QueryUCID request and response are
    • {id: “35”, request: “queryucid”, callid: “123”}
    • {“msgtype”: “response”, “id”: “35”, “result”: “success”, “ucid”: “00001148011456795778”}
  • The JSON string for SetDoNotDisturb request and response are
    • {id: “36”, request: “setdonotdisturb”, extension: “101”, dnd: “true”}
    • {“msgtype”: “response”, “id”: “36”, “result”: “success”, “error”: “”}
  • The JSON string for SetForwarding request and response are
    • {id: “37”, request: “setforwarding”, extension: “101”, destination: “102”, fwd: “true”}
    • {“msgtype”: “response”, “id”: “37”, “result”: “success”, “error”: “”}
  • The JSON string for SetMsgWaitingInd request and response are
    • {id: “38”, request: “setmsgwaitingind”, extension: “101”, ind: “true”}
    • {“msgtype”: “response”, “id”: “38”, “result”: “success”, “error”: “”}
  • The JSON strings for incoming Call Offer event is
    • {msgtype: “event”, eventtype: “offer”, “referenceid”: 1, origcalling: “101”, origcalled: “102”, calling: “101”, called: “102”, alerting: “102”, ucid: “00001094861421138402”, uui: “”, uec: “”, split: “”, custdata: “”, time:1424044800, trunkgroup: “10”, trunkmember: “12”, lastredirection: “”, callid: 48}
  • The JSON string for outgoing Call Alert event is
    •  {“msgtype”: “event”, “eventtype”: “alert”, “referenceid”: 1, “origcalling”: “101”, “origcalled”: “102”, “calling”: “101”, “called”: “102”, “alerting”: “102”, “ucid”: “00001000481428289124”, “uui”: “”, “custdata”: “”, “time”: 1428289128, “trunkgroup”: “5”, “trunkmember”: “118”, “callid”: 48}
  • The JSON string for Call Connect event is
    • {“msgtype”: “event”, “eventtype”: “connect”, “referenceid”: 1, “origcalling”: “101”, “origcalled”: “102”, “calling”: “101”, “called”: “102”, “answering”: “102#2”, “ucid”: “00001000481428289124”, “uui”: “”, “uec”: “”, “split”: “”, “custdata”: “”, “time”: 1428289134, “trunkgroup”: “5”, “trunkmember”: “118”, “lastredirection”: “”, “callid”: 48}
  • The JSON string for Call Fail event is
    • {msgtype: “event”, eventtype: “fail”, “referenceid”: 1, failing: “101”, called: “102”, cause: 23, time:1424044800, callid: 48}
  • The JSON string for Call Hold event is
    • {“msgtype”: “event”, “eventtype”: “hold”, “referenceid”: 1, “holding”: “101”, “time”: 1428289135, “callid”: 48}
  • The JSON string for Call Retrieve event is
    • {msgtype: “event”, eventtype: “retrieve”, “referenceid”: 1, retrieving: “101”, time:1428289135, callid: 48}
  • The JSON string for Call Disconnect event is
    • {“msgtype”: “event”, “eventtype”: “disconnect”, “referenceid”: 1, “releasing”: “101”, “uui”: “”, “custdata”: “”, “time”: 1428289136, “callid”: 48}
  • The JSON string for Call Transfer event is
    • {msgtype: “event”, eventtype: “transfer”, “referenceid”: 1, transferring: “101”, transferred: “102”, ucid: “00001094861421138402”, uui: “”, cusdata: “”, time:1424044800, trunkgroup: “10”, trunkmember: “12”, primarycallid: 123, secondarycallid: 124, party1: “101”, party2: “102”, party3: “”, party4: “”, party5: “”, party6: “”}
  • The JSON string for Call Conference event is
    • {msgtype: “event”, eventtype: “conference”, “referenceid”: 1, controller: “101”, addedparty: “102”, ucid: “00001094861421138402”, uui: “”, cusdata: “”, time:1424044800, trunkgroup: “10”, trunkmember: “12”, primarycallid: 123, secondarycallid: 124, party1: “101”, party2: “102”, party3: “”, party4: “”, party5: “”, party6: “”}
  • The JSON string for Call Idle event is
    • {msgtype: “event”, eventtype: “idle”, “referenceid”: 1, time: 1424044800, “extension”: “101”}

Uninstallation

  • Stop the Window Service ivrSVR
  • Open Windows Command Prompt, enter the following commands to uninstall the program from Windows Service
    • cd c:\program files\ivrsvr
    • ivrSVR -u

Support and License

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s