Introduction
The astCTI is a CTI server for Asterisk. The astCTI uses ARI to monitor agent extensions, it hides the technical details of ARI and provides ActiveX, REST and WebSocket interfaces for front end application development. Currently, the astCTI program only supports the following functions:
- StartMonitor – Start monitor of agent extension
- StopMonitor – Stop monitor of agent extension
- MakeCall – Make a call
- Hangup – Hangup a call
- Snapshot – Snapshot a device
Testing Program
- I have prepared a testing program called “AstClientVC.exe” which uses the ActiveX to connect to the astCTI, the screenshot of the program is
Preparation and Password Encryption
- The access MDB file stored the ARI username and password of Asterisk server. For security reason, a tool called encryptpasswd.exe is provided for you to generate an encrypted password for the installation and configuration of the software
- Execute the program, generate an encrypted password for the ARI user of Asterisk server, then paste the encrypted password to the parameter ivr_tlink. For example, the encrypted password for “p@ssword” is “R3NIw1yJMLlnPFzEQtuh2A==”
64 bit Windows System
- For 64 bit Windows system, please follow the steps below
- Configure ODBC System DSN using
- C:\Windows\SysWOW64\odbcad32.exe
- Stop the Windows firewall because it enables by default and telnet port 14021 is required for this application.
- Configure ODBC System DSN using
Installation
- Download the astCTI zip file here.
- Follow the installation steps below to install the software.
- Extract all the files into directory c:\program files\astCTI
- Open Windows Command Prompt, enter the following commands to register the program as Windows Service
- cd c:\program files\astCTI
- astCTI -i
- Open ODBC Setting, create a System DSN called ASTCTICFG for Microsoft Access Driver and point to astcti.mdb which is located in the directory c:\program files\astCTI
- Open the Access file, edit the value of parameters acti_tlink_01 and acti_tlink_02 to define the ARI parameters of your Asterisk servers in the tParameter table. The format is ip#port#app,username,encryptpasswd. For example, my setting is 192.168.1.124#8088#astcti,astcti,R3NIw1yJMLlnPFzEQtuh2A==
- Start the Windows Service astCTI
- Telnet to localhost and port number 14021, enter username tcpgate and password tcpgate01 to access the program console
- Enter the following command to add extension and monitored by astCTI
- add extension 101 PJSIP
- Hint: add extension 101 and monitored by astCTI
- Hint: extension 101 is using technology PJSIP, you can use technology SIP
- Enter the following command in the program console to modify the default technology type of added extension
- update parameter acti_defaultexttype PJSIP
- 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
Add Asterisk REST Interface User
REST Interface
- Enter the following command in the program console to add an ActiveX interface port
- add tcp 9001 * * custom astctirest
- ACD Login
- ACD Logout
- ACD SetState
- MakeCall
- Answer
- Hangup
- Hold
- Retrieve
- Transfer
- Conference
- Consultation
- Reconnect
- Alternate
- DTMF
- UserData
- Snapshot
ActiveX Interface
- Enter the following command in the program console to add an ActiveX interface port
- add tcp 9002 * * custom astctiapi
WebSocket Interface
- Enter the following command in the program console to add a WebSocket interface port
- add tcp 9003 * * custom astctiws
- 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: “102”, data: “hello”}
- {msgtype: “response”, id: “1”, result: “success”, channel: {name: “channelname”, id: “channelid”}}
- The JSON strings for Hold call request and response are
- The JSON strings for Retrieve call request and response are
- The JSON strings for Hangup call request and response are
- {id: “2”, request: “hangup”, extension: “101”, data: “world”}
- {msgtype: “response”, id: “2”, result: “success”, channel: {name: “channelname”, id: “channelid”}}
- The JSON strings for Answer call request and response are
- The JSON strings for Consultation call request and response are
- The JSON strings for Reconnect call request and response are
- The JSON strings for Alternate call request and response are
- The JSON strings for Transfer call request and response are
- The JSON strings for Conference call request and response are
- The JSON strings to send DTMF request and response are
- The JSON strings for ACD Login request and response are
- The JSON strings for ACD Logout request and response are
- The JSON strings for ACD SetState request and response are
- 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
- The JSON strings for Hangup UserData request and response are
- Please refer this post for JSON events
Uninstallation
- Stop the Window Service astCTI
- Open Windows Command Prompt, enter the following commands to uninstall the program from Windows Service
- cd c:\program files\astCTI
- astCTI -u
Support and License
- Please contact upinget.com for support and license