If you already have Asterisk or FreePBX, you can run call campaigns through your own PBX: from your numbers, through your carrier and at your own call rates. The contact sees a familiar number and calls you back directly, while the platform handles scenarios, speech recognition, the AI agent and reports.
Setup takes one SIP trunk. Below are ready-made config snippets for plain Asterisk and the interface fields for FreePBX.
How the call works
There is one direction: we start the call. The platform sends your PBX an INVITE with the contact's number as the called number. Your PBX handles this call the same way as if an employee had dialed the number from an internal phone, and sends it out through your carrier.
This leads to two consequences that shape the whole setup:
- The trunk must lead to outbound routes. If you leave it in the inbound context, the PBX will treat our call as a call to an unknown number and won't send it anywhere.
- The CallerID must be replaced with your number. In our INVITE the “from” field holds an internal tag. You can use it to match your CDR against our export, but it is not a phone number, and the carrier will reject such a call.
No registration is needed in either direction: we identify your PBX by its static public IP. Behind NAT or on a dynamic address the connection will not work, because we simply don't know where to send the call.
Connection settings
| Signaling address | pbx.autocall.kz |
| IP for the firewall | 109.233.108.218 |
| Port | 5060 — UDP,
5061 — TLS
|
| Voice (RTP) | subnet 109.233.108.208/28, ports 10000–20000 |
| Codec | opus or alaw |
| Number format | +7XXXXXXXXXX |
| Registration | not needed, identified by IP |
Step 1. Firewall
Signaling comes from one address and voice from a subnet: these are different servers on our side, and that is normal. You need to open both, or you get the classic picture of “the call connected, but there's silence on the line”.
# signaling udp dport 5060 ip saddr 109.233.108.218 accept tcp dport 5061 ip saddr 109.233.108.218 accept # voice udp dport 10000-20000 ip saddr 109.233.108.208/28 accept
iptables -A INPUT -p udp --dport 5060 -s 109.233.108.218 -j ACCEPT iptables -A INPUT -p tcp --dport 5061 -s 109.233.108.218 -j ACCEPT iptables -A INPUT -p udp --dport 10000:20000 -s 109.233.108.208/28 -j ACCEPT
Step 2. Trunk in plain Asterisk
You need three sections: endpoint, identify and, only if you want us to authenticate, auth.
[autocall] type=endpoint context=from-autocall transport=transport-udp disallow=all allow=opus,alaw ; opus only if codec_opus is loaded, otherwise allow=alaw direct_media=no rtp_symmetric=yes force_rport=yes ; auth=autocall-auth ; uncomment if you require authentication [autocall] type=identify endpoint=autocall match=109.233.108.218 ; [autocall-auth] ; type=auth ; auth_type=userpass ; username=your_login ; password=your_password
type=identify with match is the “identification by IP”: any call from our address lands on this endpoint and goes to the from-autocall context.
Step 3. Dialplan
The context does two jobs: it sends calls to regular numbers out and connects to an extension if the scenario transfers the contact to an operator.
[from-autocall] ; extensions, for the “connect to extension” element exten => _XXX,1,Dial(PJSIP/${EXTEN},60) same => n,Hangup() ; everything else goes out through your carrier, with the number replaced by yours exten => _+7XXXXXXXXX,1,Set(CALLERID(num)=7XXXXXXXXXX) same => n,Dial(PJSIP/${EXTEN:1}@your-carrier,60) same => n,Hangup()
Adjust the _XXX pattern to the length of your extensions; ${EXTEN:1} strips the + if your carrier accepts numbers without a plus. Dialing formats differ between carriers, and this is the only place where you will need to check your contract.
Don't send our trunk to from-internal on plain Asterisk “the way FreePBX does it”. A clean install has no such context, and if you created one yourself, check that it has no access to service codes and call forwarding. A separate context just for our calls is safer and clearer.
Step 4. Trunk in FreePBX
Connectivity → Trunks → Add Trunk → Add SIP (chan_pjsip) Trunk.
General tab
- Trunk Name:
autocall - Outbound CallerID: your number in the
7XXXXXXXXXXformat - Maximum Channels: the same number you set in the PBX settings in the dashboard
pjsip Settings → General
- Username and Secret: leave empty
- Authentication:
None, Registration:None - SIP Server:
pbx.autocall.kz, Port:5060 - Context:
from-internal
Context is the key field in the whole setup. By default FreePBX gives the trunk from-pstn, and our call ends up in inbound processing: FreePBX looks for an Inbound Route for the contact's number, finds none and ends the call. With from-internal the call goes through your Outbound Routes, exactly like an employee's call.
pjsip Settings → Advanced
- Codecs:
opusandalaw, opus first. Enable opus only ifcodec_opusis loaded in Asterisk (check:asterisk -rx "module show like codec_opus"). Without it, keep onlyalaw, or the call won't be able to pass to the carrier line. - Match (Permit):
109.233.108.218, the address FreePBX uses to recognize our calls - Media Encryption:
None, orSRTP via in-SDPif you chose TLS + SRTP - Qualify Frequency:
60
Next, check that your Outbound Route accepts numbers in the format we send them (+7XXXXXXXXXX) and sets your CallerID. If the Firewall module is enabled, add our addresses to the trusted zone, or it will drop calls before Asterisk sees them.
Encryption: TLS and SRTP
If the PBX faces the internet with a public address, it's worth securing the signaling. On the Asterisk side this is a transport and one parameter on the endpoint:
[transport-tls]
type=transport
protocol=tls
bind=0.0.0.0:5061
cert_file=/etc/asterisk/keys/fullchain.pem
priv_key_file=/etc/asterisk/keys/privkey.pem
method=tlsv1_2
[autocall]
type=endpoint
transport=transport-tls
media_encryption=sdes
; other parameters as above
In the dashboard, choose the TLS transport and, if you need SRTP, the matching voice encryption mode.
SRTP works only together with TLS. The voice encryption key travels right inside the SIP message: over unencrypted signaling it would go out in plain text next to the “encrypted” stream. That only looks like protection, so we don't allow this combination. At the same time, TLS without SRTP is a normal option: in Kazakhstan many phones and PBXs have SRTP stripped from the firmware while TLS works.
Step 5. Add the PBX in the dashboard
Go to “PBX” → “Connect a PBX”. You will need:
- the PBX's IP address and port;
- transport, UDP or TLS, and voice encryption if it is enabled;
- login and password, only if your PBX requires authentication;
- the limit of concurrent channels and the dialing rate: set them no higher than your carrier allows, and we won't exceed them.
Once saved, the PBX status appears in the list: “Responding” means it answers our connection checks. Then, when you create a call campaign, choose your PBX in the “PBX for calls” field, and the estimate is recalculated right away at the discounted per-second rate.
If calls don't go through
- The dashboard shows “Not responding” and there are no calls at all. The firewall is closed or the PBX listens on the wrong interface. Check
pjsip show transports. - INVITE arrives but gets 404 or 603 right away. The call landed in the wrong context. Turn on
pjsip set logger onand see which context the call went to. - The carrier rejects calls. Our internal tag goes out instead of your number: CallerID override isn't set up.
- The call connects, but there's silence. The voice subnet
109.233.108.208/28isn't open on ports 10000–20000, or the PBX is behind NAT withoutexternip. - Some calls drop in the first seconds. This is usually a codec mismatch: check that only
opusandalaware allowed on the trunk, and opus only whencodec_opusis loaded.
What it costs
When you call through your own PBX, you pay your carrier for the call minutes, and only the platform's work remains on our side, so a second costs several times less than usual. Retry attempts through your own PBX are free: there is no reason to pay for the persistence of our line when the line is yours.
Do I need to register the trunk on the AutoCall.kz side?
No. We send the call to your PBX's IP ourselves, so no registration is needed in either direction. A login and password are only needed if your PBX itself requires authentication from an inbound trunk.
Why do calls reach Asterisk but never go out to the contact?
The trunk points to the wrong context. The call arrives for the contact's number and has to land where the PBX sends calls out: in FreePBX that is from-internal, in plain Asterisk it is your context routing to the carrier trunk.
Which CallerID will the contact see?
The one your outbound route sets. In our call the “from” field holds an internal identifier like 59336790, the call's number in our system: it's handy for matching CDRs, but it is not a phone number, and the carrier will reject it.
Can I use TLS and SRTP?
Yes: TLS transport on port 5061 and media_encryption=sdes. SRTP is allowed only over TLS, otherwise the encryption key travels in plain text.
How do I check that the trunk works?
In the dashboard, the PBX status is based on connection checks. Next, run a call campaign to one of your own numbers: pjsip set logger on shows the incoming INVITE and where it went next.
If something doesn't add up, write to support and attach the pjsip set logger on output from a test call. It shows whether the call arrived, which context it landed in and what your PBX answered.