Configure your Asterisk PBX to connect with IPComms SIP trunking services using PJSIP or chan_sip.
Use the following settings to configure your Asterisk trunk. Find your credentials in the IPComms Portal under SIP Trunking.
| Setting | Standard SIP | TLS/SRTP |
|---|---|---|
| SIP Server | [subdomain].s1.ipcomms.net | [subdomain].s1.ipcomms.net |
| Port | 5060 (UDP) | 5061 (TCP/TLS) |
| Username | [Your Trunk Username] | |
| Password | [Your Trunk Password] | |
| Codecs | G.711 (ulaw/alaw), G.729 | |
| DTMF Mode | RFC 2833 | |
Note: Replace [subdomain] with your assigned subdomain from the portal (e.g., abc1234.s1.ipcomms.net).
PJSIP is the recommended SIP channel driver for Asterisk 13+. Add the following to your pjsip.conf file:
; ============================================ ; IPComms SIP Trunk - PJSIP Configuration ; File: /etc/asterisk/pjsip.conf ; ============================================ ; Transport for standard SIP [transport-udp] type=transport protocol=udp bind=0.0.0.0:5060 ; IPComms Trunk Registration [ipcomms] type=registration transport=transport-udp outbound_auth=ipcomms-auth server_uri=sip:YOUR_SUBDOMAIN.s1.ipcomms.net client_uri=sip:YOUR_USERNAME@YOUR_SUBDOMAIN.s1.ipcomms.net contact_user=YOUR_USERNAME retry_interval=60 expiration=3600 ; Authentication [ipcomms-auth] type=auth auth_type=userpass username=YOUR_USERNAME password=YOUR_PASSWORD ; AOR (Address of Record) [ipcomms-aor] type=aor contact=sip:YOUR_SUBDOMAIN.s1.ipcomms.net:5060 qualify_frequency=60 ; Endpoint Configuration [ipcomms-endpoint] type=endpoint transport=transport-udp context=from-ipcomms disallow=all allow=ulaw allow=alaw outbound_auth=ipcomms-auth aors=ipcomms-aor direct_media=no dtmf_mode=rfc4733 rtp_symmetric=yes force_rport=yes rewrite_contact=yes from_domain=YOUR_SUBDOMAIN.s1.ipcomms.net from_user=YOUR_USERNAME ; Identify incoming calls from IPComms [ipcomms-identify] type=identify endpoint=ipcomms-endpoint match=YOUR_SUBDOMAIN.s1.ipcomms.net
Replace the following values:
YOUR_SUBDOMAIN - Your IPComms subdomain (e.g., abc1234)
YOUR_USERNAME - Your trunk username from the portal
YOUR_PASSWORD - Your trunk password from the portal
Note: chan_sip is deprecated in newer versions of Asterisk. We recommend using PJSIP for new installations.
Add the following to your sip.conf file:
; ============================================ ; IPComms SIP Trunk - chan_sip Configuration ; File: /etc/asterisk/sip.conf ; ============================================ ; General Settings (add to [general] section) [general] register => YOUR_USERNAME:YOUR_PASSWORD@YOUR_SUBDOMAIN.s1.ipcomms.net/YOUR_USERNAME ; IPComms Trunk Definition [ipcomms] type=peer host=YOUR_SUBDOMAIN.s1.ipcomms.net port=5060 username=YOUR_USERNAME secret=YOUR_PASSWORD fromuser=YOUR_USERNAME fromdomain=YOUR_SUBDOMAIN.s1.ipcomms.net context=from-ipcomms insecure=port,invite qualify=yes disallow=all allow=ulaw allow=alaw dtmfmode=rfc2833 nat=force_rport,comedia directmedia=no
IPComms uses E.164 format for phone numbers. Outbound calls should be sent as +1NPANXXXXXX (e.g., +14045551234).
; ============================================ ; IPComms Dialplan - Outbound Calls ; File: /etc/asterisk/extensions.conf ; ============================================ [outbound-ipcomms] ; 11-digit dialing (1NPANXXXXXX -> +1NPANXXXXXX) exten => _1NXXNXXXXXX,1,NoOp(Outbound call to ${EXTEN}) same => n,Set(CALLERID(num)=+1YOUR_DID_NUMBER) same => n,Dial(PJSIP/+${EXTEN}@ipcomms-endpoint,60) same => n,Hangup() ; 10-digit dialing (NPANXXXXXX -> +1NPANXXXXXX) exten => _NXXNXXXXXX,1,NoOp(Outbound call to ${EXTEN}) same => n,Set(CALLERID(num)=+1YOUR_DID_NUMBER) same => n,Dial(PJSIP/+1${EXTEN}@ipcomms-endpoint,60) same => n,Hangup() ; International Dialing (011 + Country Code + Number) exten => _011.,1,NoOp(International call to ${EXTEN}) same => n,Set(INTL_NUM=${EXTEN:3}) same => n,Dial(PJSIP/+${INTL_NUM}@ipcomms-endpoint,120) same => n,Hangup()
[from-ipcomms] ; Handle incoming calls to your DID exten => _+1NXXNXXXXXX,1,NoOp(Incoming call from ${CALLERID(num)}) same => n,Answer() same => n,Dial(PJSIP/100,30) same => n,Voicemail(100@default,u) same => n,Hangup()
For encrypted calls, use TLS for signaling and SRTP for media encryption.
; TLS Transport [transport-tls] type=transport protocol=tls bind=0.0.0.0:5061 cert_file=/etc/asterisk/keys/asterisk.pem ca_list_file=/etc/asterisk/keys/ca.crt method=tlsv1_2 ; TLS Endpoint with SRTP [ipcomms-endpoint-tls] type=endpoint transport=transport-tls context=from-ipcomms disallow=all allow=ulaw allow=alaw outbound_auth=ipcomms-auth aors=ipcomms-aor-tls direct_media=no dtmf_mode=rfc4733 media_encryption=sdes media_encryption_optimistic=yes
asterisk -rx "pjsip show registrations"direct_media=no is setrtp_symmetric=yes and force_rport=yes# Check PJSIP registration status asterisk -rx "pjsip show registrations" # Check endpoint status asterisk -rx "pjsip show endpoint ipcomms-endpoint" # Enable SIP debugging asterisk -rx "pjsip set logger on" # Reload configuration asterisk -rx "pjsip reload"
Our technical support team can assist with trunk configuration and troubleshooting.