SIPFLEX GUIDE

Asterisk PJSIP registration

Build the trunk with separate transport, registration, auth, AOR and endpoint sections using the values in your portal.

Before you start

Sign in to the Sipflex portal and open the trunk you want to connect. Keep the profile, phone number or username and account-specific credentials visible while you configure your system.

  • A current supported Asterisk release
  • PJSIP enabled
  • Trunk username and separate trunk password from Sipflex
  • A restricted inbound dialplan destination
Use the current Sipflex endpoints.

The SIP registrar is sip.sipflex.co.uk and the IAX2 host is iax.sipflex.co.uk. Usernames and passwords remain account-specific and are shown in your portal.

Configure the connection

  1. Back up pjsip.conf and extensions.conf.
  2. Create or reuse the UDP transport below; use the cookbook if you require TCP or TLS.
  3. Replace TRUNK_USERNAME and TRUNK_PASSWORD with the values from your Sipflex portal.
  4. Add the registration, auth, AOR, endpoint and identify sections.
  5. Create the restricted from-sipflex and outbound-sipflex dialplan contexts.
  6. Reload PJSIP and the dialplan, then run pjsip show registrations and pjsip show endpoints.
; /etc/asterisk/pjsip.conf
[sipflex-udp]
type=transport
protocol=udp
bind=0.0.0.0

[sipflex-registration]
type=registration
transport=sipflex-udp
outbound_auth=sipflex-auth
server_uri=sip:sip.sipflex.co.uk:5060
client_uri=sip:TRUNK_USERNAME@sip.sipflex.co.uk
retry_interval=60

[sipflex-auth]
type=auth
auth_type=userpass
username=TRUNK_USERNAME
password=TRUNK_PASSWORD

[sipflex-aor]
type=aor
contact=sip:sip.sipflex.co.uk:5060

[sipflex-endpoint]
type=endpoint
transport=sipflex-udp
context=from-sipflex
disallow=all
allow=alaw
allow=ulaw
dtmf_mode=rfc4733
outbound_auth=sipflex-auth
aors=sipflex-aor
from_user=TRUNK_USERNAME
direct_media=no

[sipflex-identify]
type=identify
endpoint=sipflex-endpoint
match=52.56.188.70/32

; /etc/asterisk/extensions.conf
[from-sipflex]
exten => _X.,1,NoOp(Incoming Sipflex call to ${EXTEN})
 same => n,Dial(PJSIP/your-destination)
 same => n,Hangup()

[outbound-sipflex]
exten => _X.,1,Dial(PJSIP/${EXTEN}@sipflex-endpoint)
 same => n,Hangup()

Generate a customised configuration

Verify the service

  1. Confirm the trunk is registered or that the correct public peer IP is saved in the Sipflex portal.
  2. Place an outbound test call and check the caller ID presented.
  3. Call the Sipflex number from another network and confirm it reaches the expected inbound context or route.
  4. Check two-way audio and RFC4733/RFC2833 DTMF.

Support scope

We can check Sipflex credentials, registration state and provider-side call routing. Your PBX, device, firewall, dial plan and application remain your responsibility.

Contact support