Leksta
Send Asterisk Call Recordings to Leksta Over HTTPS

Send Asterisk Call Recordings to Leksta Over HTTPS

· Updated

Score every call against your checklist, not a sample

Request a demo

To send Asterisk call recordings over HTTPS to Leksta, you install a small agent on the PBX and create a token in the console. The agent uploads each finished recording to Leksta over an outbound connection that your server opens, so you open no inbound port and share no password. It works the same for FreeSWITCH, in Leksta's cloud and on-premise. This guide compares it with SFTP pull and Shared folder.

In short: HTTPS push sends each finished Asterisk or FreeSWITCH recording to Leksta over an encrypted, outbound-only connection. It needs a revocable token and one small agent, and it is available now. Choose it unless your policy requires Leksta to pull from your server.

How can you send Asterisk call recordings to Leksta?

You choose one of four Recording import modes on your PBX connection in Settings → Telephony. Each connection uses exactly one mode.

  • HTTPS push. An agent on your PBX uploads every finished recording to Leksta. This is the recommended mode.
  • SFTP pull. Leksta logs in to a read-only SFTP folder on your server with a password, verifies your server's host key and reads the recordings.
  • Shared folder. Leksta reads recordings from a folder it can see, such as a mounted or copied directory. This mode is for on-premise installations only.
  • Off. No recordings are imported.

Leksta only receives recordings. It does not touch live calls, so your call routing stays unchanged.

Recording import options in Leksta's PBX connection form, with HTTPS push selected

Why choose HTTPS push for call recordings?

HTTPS push keeps your PBX in control of what leaves it, because your server starts every connection. The properties below matter most to the person who runs the PBX.

  • Outbound 443 only. The agent uploads over port 443, so the inbound port on your PBX stays closed. Leksta needs no firewall rule for its address and no SSH user.
  • Encrypted in transit. The agent requires TLS 1.2 or newer. Plain HTTP is accepted only when the agent talks directly to a Leksta server inside your private LAN.
  • Revocable tokens. Each PBX gets its own token. Leksta shows a token once and stores only its hash. A tenant can have up to 5 active tokens.
  • Optional IP allow-list and mutual TLS (mTLS). You can restrict pushes to the public addresses or CIDR ranges of your PBX; Leksta refuses any other address. If your reverse proxy checks client certificates, the agent supports mTLS and a custom CA.
  • Integrity check. The agent sends the SHA-256 hash of each file, and Leksta compares it. Leksta refuses a damaged file and the agent sends it again.
  • No duplicates. Leksta imports identical audio once, so a retried upload never creates a second call.
  • An open-source agent your security team can read. The agent, leksta-recording-push, is a plain bash script under the Apache-2.0 license, published on GitHub. Releases ship SHA256SUMS and a build provenance attestation, so admins can read and verify the script before install. It runs as an unprivileged user.
  • Nothing about your server is stored. For this mode, Leksta keeps no address, login or password of your PBX.

Leksta accepts files up to 200 MB. For how Leksta handles data in general, see the security page.

HTTPS push, SFTP pull or Shared folder: which one fits?

Choose HTTPS push for most teams, SFTP pull when policy requires Leksta to read from your server, and Shared folder for on-premise installations where the PBX writes to a disk that Leksta mounts.

HTTPS push SFTP pull Shared folder
Who opens the connection Your PBX Leksta Nobody: a mounted or copied folder
Inbound port on your PBX None Yes (for example 2222/tcp) None
What Leksta stores A token hash only SFTP password and host key No credentials
Leksta cloud (SaaS) Yes Yes No
On-premise Yes Yes Yes
How you revoke access Delete the token Change the password Unmount the folder
Setup effort Install one agent SSH user, chroot, firewall Mount or copy a folder

With Shared folder, Leksta checks the folder every 60 seconds and imports a file once its size and modification time stay unchanged across two checks.

SFTP pull fields for an Asterisk connection: host, port, user and password

How do you set up HTTPS push?

Setup takes eight steps and is the same for Asterisk and FreeSWITCH. The console and the agent include a setup guide for both.

  1. Open Settings → Telephony and open your Asterisk or FreeSWITCH connection.
  2. In Recording import, choose HTTPS push and save.
  3. Optionally, enter the public addresses of your PBX in the allowed addresses field, for example 203.0.113.10/32.
  4. Click Create token, name it after the PBX host and copy it. Leksta shows it only once.
  5. On the PBX, download the agent from the panel, check its SHA-256 and run sudo bash leksta-recording-push.sh install. Root is needed only for this step.
  6. Set the recordings folder in /etc/leksta/recording-push.env: the folder where your PBX writes finished recordings.
  7. In the same file, add the endpoint address and the token.
  8. Run sudo -u leksta-push leksta-recording-push test. You should see OK: server reachable and token accepted.

HTTPS push settings in Leksta: access tokens and the IP allow-list

After installation, a systemd timer runs the agent every 30 seconds. It sends files that have stopped changing and retries failed uploads with a growing delay. It watches the recordings folder, so you change nothing in the Asterisk dialplan.

Install tabs for Asterisk and FreeSWITCH in the HTTPS push panel

Want to review your own calls this way?

14 days and 120 minutes of calls free, no card

How does Leksta read call details from file names?

Leksta takes the call time, the numbers and the direction from the recording file name, for example out-<callee>-<caller>-YYYYMMDD-HHMMSS-<uniqueid>.wav. It reads the time in your company (tenant) time zone, so keep the time zone in the file names consistent with it, or call times shift by the difference. Imported calls appear in the Calls list.

Leksta's Calls list with analyzed calls from a connected PBX

What happens when a token is revoked or an upload fails?

The agent never deletes a recording because a request failed. If you revoke a token, the next upload from that server returns HTTP 401 and all files stay on your PBX. Create a new token, update the config and run the test command again. A damaged upload returns 422 and is sent again on the next pass.

Does HTTPS push work on-premise?

Yes. Use the address of your own installation in the agent config, and recordings stay inside your installation. If your installation uses a certificate from your own CA, set the CA file on the PBX. If a reverse proxy sits in front of Leksta, raise its body limit to 200 MB for the ingest path.

Try it on your own recordings

Connect a PBX and see your calls transcribed and scored by Leksta speech analytics. Start a free trial in the cloud, or request a demo and we will show the import on your setup. To run Leksta on your own servers, discuss installation with our team.

To go further, read how to connect your PBX to AI and how call transcription to text works.

FAQ

Do I need to change the Asterisk dialplan for HTTPS push?

No. The agent watches the recordings folder and sends files that already exist, so your dialplan and call routing stay as they are. Name the files in a pattern that Leksta can read, so it picks up the call time, the direction and the phone numbers.

Can I use HTTPS push and SFTP pull at the same time?

No. A PBX connection has one recording import mode: HTTPS push, SFTP pull, Shared folder or Off. Choose the mode that matches your security policy and your edition. Shared folder is available on-premise only, so cloud connections choose between HTTPS push and SFTP pull.

Why are my call times shifted by a few hours?

Leksta reads the time in the file name in your company (tenant) time zone. If the PBX writes file names in another time zone, call times shift by the difference. Align the PBX clock zone with the tenant zone, or write the time in the file name in the tenant zone.

What happens if my PBX is offline for a day?

The agent keeps a list of the files it has sent. When the PBX is back online and the agent runs again, it sends the files that are still missing. Keep your own retention on the PBX longer than the outage, so no recording is removed before it is uploaded.

How do I stop recordings from one server?

Delete that server's token in the HTTPS push panel. The next upload from that server receives HTTP 401, and the recordings stay on the PBX. Other PBX servers keep working, because each one has its own token. To resume, create a new token and update the agent config.

Try Leksta on your own calls

Connect your PBX and get your first scores within 14 days, free, no card needed

  • Lost deal reasons: how to capture them from calls and act on them

    The most reliable way to track lost deal reasons is to take them from conversations, not from a rep's memory. Keep a short list of reasons, record one for every lost deal, and write "reason not stated" when the customer gave none. Review the trend weekly, then change the script, the price or the process.

  • Lead vs Deal: What to Create in Your CRM After a Call

    A lead is an inquiry where it is not yet clear whether the person will buy. A deal is an actual sale with stages, an amount and an owner. If calls come from mixed sources and some are random, create a lead and qualify it. If almost every call is already an order, create a deal. Bitrix24 example inside.

  • Auto-reply to customer emails: which to answer instantly and which to hand to a person

    An auto-reply to customer emails fits messages with one clear answer: confirmation of receipt, business hours, order status. Keep complaints, money and key accounts for a person, and do not answer newsletters or cold pitches at all. Here are the signs of a mailing, the exceptions, and how to set up an auto-reply without losing a customer.