Asterisk
Send and receive calls through Vonyx with PJSIP.
Connect Asterisk to Vonyx with a PJSIP trunk. You get outbound calls on your Vonyx numbers, and inbound calls into your dialplan.
Before you start
- A Vonyx SIP trunk with a number attached
- Asterisk 16 or later with
res_pjsip(PJSIP) - A public IP or hostname for Asterisk, with UDP
5060and your RTP range open to43.204.9.41
Outbound calls
Add the trunk to pjsip.conf
Replace the username and password with your trunk's values. There is no registration section: Vonyx checks credentials on each call and doesn't need Asterisk to register.
ulaw and alaw are PCMU and PCMA, the only codecs Vonyx supports. On recent Asterisk releases auth_type = userpass is deprecated and treated as digest; either works.
Set NAT if Asterisk is behind a router
If Asterisk has a private IP, uncomment the three NAT lines on the transport:
external_media_addressandexternal_signaling_address: your public IP. Asterisk writes it into SIP headers and the SDP for traffic leavinglocal_net.local_net: your LAN range. Add one line per range.
Forward UDP 5060 and your RTP range to Asterisk, and turn off SIP ALG on the router.
Set the RTP port range
Vonyx sends RTP from UDP 10000–20000. Your own range, set in rtp.conf, must be open to 43.204.9.41:
Add the outbound dialplan
Outbound calls must use one of your Vonyx numbers as caller ID.
Include outbound in the context your phones use.
Inbound calls
Add the inbound context
The identify section matches calls from 43.204.9.41 to the vonyx endpoint, which sends them to from-vonyx.
Replace these steps with your IVR, queue or agent.
Point Vonyx at Asterisk
In the Vonyx console, open the trunk, turn on Inbound calls, and set Inbound address to Asterisk's public host, for example pbx.example.com:5060. See Inbound calls.
Test the connection
The originate call rings 91XXXXXXXXXX and plays a prompt when answered. Then call your Vonyx number from a mobile and check that it reaches from-vonyx. Use pjsip set logger on to see the SIP messages.
Limitations
- DTMF and call transfer are not available on Vonyx yet. Don't rely on
Read()/ IVR key presses orTransfer()on Vonyx calls. - New accounts make 1 call at a time (raise limits).
- No TLS or SRTP: use a UDP or TCP transport on port
5060.
Troubleshooting
| Problem | Fix |
|---|---|
401 or 407 that never succeeds | Check username and password in vonyx-auth, and that the endpoint has outbound_auth = vonyx-auth. |
429 after auth succeeds | The caller ID isn't one of your Vonyx numbers. |
| Inbound calls rejected or sent to the wrong context | Check the identify section matches 43.204.9.41 and that pjsip show identifies lists it. |
488 Not Acceptable Here | Allow only ulaw and alaw on the endpoint. |
| One-way or no audio | Set external_media_address, external_signaling_address and local_net behind NAT, and open your rtp.conf range to 43.204.9.41. |
More in SIP troubleshooting.