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
- Back up pjsip.conf and extensions.conf.
- Create or reuse the UDP transport below; use the cookbook if you require TCP or TLS.
- Replace TRUNK_USERNAME and TRUNK_PASSWORD with the values from your Sipflex portal.
- Add the registration, auth, AOR, endpoint and identify sections.
- Create the restricted from-sipflex and outbound-sipflex dialplan contexts.
- 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
- Confirm the trunk is registered or that the correct public peer IP is saved in the Sipflex portal.
- Place an outbound test call and check the caller ID presented.
- Call the Sipflex number from another network and confirm it reaches the expected inbound context or route.
- 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.