The jssip hack adds a browser-based SIP dialer to the AlterCPA Pro interface. The operator clicks the Call button on an order — the call is initiated directly in the browser via WebRTC. Clicking again ends the call.
Preparing to use the hack
VPS server
The hack requires a separate VPS server with a public IP address.
Server requirements:
- OS: Ubuntu 22.04 or Debian 12
- CPU: 2 vCPU
- RAM: 2 GB
Domain
Telephony requires a domain with a sip subdomain pointing to the server you provisioned earlier.
To create the subdomain, go to your DNS zone settings and add a record with the name sip, type A, and the server's IP address:
sip A 12.34.56.78
Installing Asterisk
To run the installer, execute the following command on the server as root:
wget https://cpa.st/setup/asterisk.sh && bash asterisk.sh <sip.yourdomain.com> <yourplatformdomain.com> <api-token>
Make sure to replace the placeholder values with your own:
- <sip.yourdomain.com> — your telephony domain
- <yourplatformdomain.com> — your AlterCPA CRM panel domain
- <api-token> — your AlterCPA administrator API key
After a successful installation, the console will display:
==> Installation complete. WSS endpoint : wss://sip.yourdomain.com:8089/ws Operator sync: every 5 min (/var/log/jssip-sync.log)
SIP provider
For the system to work correctly, your provider must meet the following requirements:
- Trunk account. The provider must have a SIP account (trunk) with a username and password, which you will need when configuring the company on the AlterCPA side.
- Support for incoming INVITE from Asterisk. The provider must accept SIP INVITE messages from your Asterisk server's IP address. If necessary, add the IP to the provider's whitelist.
- G.711 codecs (ulaw/alaw). Asterisk communicates with the provider using standard G.711 codecs. Make sure your provider supports them (virtually all do).
- Number format. Asterisk sends the number exactly as it is stored in the CRM. If the provider requires a specific format, ensure that phone numbers in orders are entered accordingly.
Additional recommendations:
- Allow SIP UDP from the Asterisk IP. If the provider uses IP filtering, add your Asterisk server's IP to the allowed list.
- Check NAT on the provider's side. Some providers require the external IP of Asterisk to be explicitly specified. If calls connect but there is no audio, the issue is likely with NAT/media addressing.
- Use UDP transport (not TCP/TLS). The Asterisk configuration uses UDP for communication with the provider. Make sure the provider accepts UDP.
- Retry interval. Asterisk retries registration with the provider every 60 seconds. After changing settings, updates will take effect within 60 seconds.
Hack settings interface
- Checkbox Server is set up and acvive. Enables the hack. Do not check this prematurely (before Asterisk installation is complete), as the browser will attempt to connect to an unavailable server and hang.
- Domain of your SIP server — the same one specified during Asterisk installation (
sip.yourdomain.com). Without protocol prefix or port number.
Configuring each company
Company configuration can be done in two ways:
- As any platform administrator via Control → Companies → Edit the desired company → the "Connect to SIP server" section.
- As the administrator of a specific company via Control → Company settings → the "Connect to SIP server" section.
The configuration is identical for both methods:
- Enable dialer in orders. Activates SIP call buttons for the company's operators.
- SIP server. The domain or IP address of your SIP provider. Host only, without
sip://prefix or port number. - Port. The SIP provider's port. Leave blank if the provider uses the default port (5060).
- User. Login credentials for the provider's system: usually a phone number or username.
- Password. The SIP account password provided by your provider.
After saving the settings, Asterisk will apply them within 15 minutes.
Important! By default, the phone number is embedded in the link in the format tel:+79999999999, making it very easy to copy. To hide the phone number from the operator, go to the company or team settings and enter id:[id] in the Call scheme URL field — this way, instead of a link containing the phone number, a link of the form id:12345 with the order number will be used, and the dialer will make a request to the platform at the moment of dialing to retrieve the actual number in encrypted form.