Asterisk PJSIP trunk config: register a ZuteSIP number

Short answer: To connect Asterisk to ZuteSIP, add five pjsip.conf sections for one trunk: a registration pointing at sip.zutesipdialer.com, an auth with your SIP username and password, an aor, an endpoint limited to ulaw and alaw, and an identify matching our server. Then route the DID in extensions.conf and dial out through the endpoint.

This is the plain-Asterisk version for people who manage config files directly. It follows the trunk layout in the official res_pjsip examples, with ZuteSIP's values filled in.

What you need

  • A ZuteSIP number plus its SIP username and password from the number's page in the dashboard.
  • Asterisk with res_pjsip loaded (any currently supported release).
  • Shell access to edit /etc/asterisk/pjsip.conf and extensions.conf, and the Asterisk CLI for testing.

ZuteSIP values used in the config

SettingValue
SIP server / registrar / domainsip.zutesipdialer.com
Transport and portUDP or TCP 5060; TLS 5061
Username<SIP_USERNAME> (from the number's page in the dashboard)
Password<SIP_PASSWORD> (from the same page)
AuthenticationDigest (username + password), registration based
CodecsG.711 µ-law (PCMU) and G.711 A-law (PCMA)
DTMFRFC 2833 (RTP events) or SIP INFO
Inbound DID<YOUR_NUMBER> in E.164 format

pjsip.conf: transport and trunk

Paste this into pjsip.conf and replace the placeholders. Skip the transport block if you already have a UDP transport. For TCP or TLS, create the matching transport and use port 5061 with TLS.

Identify matches by the source address of our SIP traffic; Asterisk resolves the hostname when the config loads.

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
; behind NAT also set:
; external_media_address=<PUBLIC_IP>
; external_signaling_address=<PUBLIC_IP>
; local_net=192.168.0.0/16

[zutesip]
type=registration
transport=transport-udp
outbound_auth=zutesip-auth
server_uri=sip:sip.zutesipdialer.com:5060
client_uri=sip:<SIP_USERNAME>@sip.zutesipdialer.com
contact_user=<YOUR_NUMBER>
retry_interval=60

[zutesip-auth]
type=auth
auth_type=userpass
username=<SIP_USERNAME>
password=<SIP_PASSWORD>

[zutesip]
type=aor
contact=sip:sip.zutesipdialer.com:5060
qualify_frequency=60

[zutesip]
type=endpoint
transport=transport-udp
context=from-zutesip
disallow=all
allow=ulaw,alaw
dtmf_mode=rfc4733
outbound_auth=zutesip-auth
aors=zutesip
from_user=<SIP_USERNAME>
from_domain=sip.zutesipdialer.com
callerid=<YOUR_NUMBER>
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes

[zutesip]
type=identify
endpoint=zutesip
match=sip.zutesipdialer.com

extensions.conf: inbound and outbound dialplan

Inbound calls land in the from-zutesip context with your number as the dialed extension. The outbound pattern sends numbers dialed with a leading plus out through the trunk.

In the outbound line, ${EXTEN} is Asterisk's dialed-number channel variable. Replace 1001 with your own extension or ring group.

[from-zutesip]
; inbound: DID = your ZuteSIP number
exten => <YOUR_NUMBER>,1,NoOp(Inbound call on ZuteSIP DID)
 same => n,Dial(PJSIP/1001,30)
 same => n,Hangup()
; catch other DID formats (with or without +)
exten => _X.,1,Goto(from-zutesip,<YOUR_NUMBER>,1)

[from-internal]
; outbound: dial +<country code><number>
exten => _+X.,1,Set(CALLERID(num)=<YOUR_NUMBER>)
 same => n,Dial(PJSIP/${EXTEN}@zutesip,60)
 same => n,Hangup()

Step-by-step: load and test

  1. Save both files and run pjsip reload and dialplan reload in the Asterisk CLI (asterisk -rvvv).
  2. Run pjsip show registrations and confirm zutesip is Registered.
  3. Run pjsip show endpoint zutesip to check codecs, the aor contact and the identify match.
  4. Call your ZuteSIP number from another phone and watch the CLI: the call should enter from-zutesip and ring extension 1001.
  5. Dial an international number from a local extension in +country format and confirm the called party sees your ZuteSIP number.

Outbound caller ID

Set the caller ID to the number that owns the SIP account, either with callerid on the endpoint or with CALLERID(num) in the dialplan as shown. Keep it matched to the credentials on the trunk. Outgoing calls draw on the number's 1,000 included minutes per month.

Troubleshooting

  • Registration 401/403: username or password mismatch, or the auth section is not linked through outbound_auth. Run pjsip set logger on and read the REGISTER exchange.
  • Inbound calls rejected as anonymous or with 'No matching endpoint found': the identify section is missing or the source address does not match. Check that the hostname resolves on your server and reload.
  • One-way audio: set external_media_address, external_signaling_address and local_net on the transport, keep rtp_symmetric and force_rport enabled, and open your rtp.conf port range in the firewall.
  • 488 Not Acceptable Here: codec mismatch. Keep allow=ulaw,alaw.
  • DTMF not detected: keep dtmf_mode=rfc4733 (the RTP-event method defined in RFC 2833); use info only if the other side requires SIP INFO.

Frequently asked questions

Do I need both registration and identify sections?

Yes. Registration tells ZuteSIP where to send your calls, and identify lets Asterisk match those incoming calls to the zutesip endpoint.

Is rfc4733 the same as RFC 2833 DTMF?

Yes. RFC 4733 updated RFC 2833 and describes the same RTP event method, which is what Asterisk's rfc4733 setting uses.

Can I use chan_sip instead of PJSIP?

chan_sip has been removed from current Asterisk releases, so PJSIP is the supported path. The same server, credentials and codecs apply.

Can I use TLS with Asterisk?

Yes. Create a TLS transport, point the registration and aor at port 5061 and reference that transport. SRTP media encryption is not offered.

How do I add a second ZuteSIP number?

Duplicate the registration, auth, aor, endpoint and identify sections under a new name with that number's credentials, and add its DID to the dialplan.

Does ZuteSIP give me an API for Asterisk?

No. There is no customer API or webhooks; Asterisk connects over standard SIP with the per-number credentials.

Related pages

Get a number in these countries

Sources