1. Home
  2. Phone
  3. Servers
  4. How to Install & Setup Asterisk PBX SIP Trunking

How to Install & Setup Asterisk PBX SIP Trunking

[su_howto_introduction text=”setting up Asterisk PBX SIP Trunking with Circuit ID”] [su_howto_steps]
1234
[su_management_portal_login]

Add your Asterisk PBX Server(s) to Circuit ID

Follow the How to Add your Server(s) to Circuit ID guide

Purchase Phone Numbers

Follow the How to Purchase Phone Numbers guide to purchase one (1) or more numbers.

Configure Asterisk PBX 

  • Login to Asterisk PBX admin panel using cli
  • update sip.conf as following
Step1: Configure SIP Trunk

[general]                
register => g.pstn.circuitid.com:5060

[circuitid]
canreinvite=no
context=mycontext
host=g.pstn.circuitid.com 
secret=NA ;NA
type=peer
username=NA
disallow=all
allow=ulaw
; allow=g729 ; Uncomment if you support G729
fromuser=phonenumber i.e. 1234567890
trustrpid=yes
sendrpid=yes
insecure=invite
nat=yes

Step2: Configure Extensions
 
update extensions.conf  as following

[mycontext]
; Make sure to include inbound prior to outbound because the _NXXNXXXXXX handler will match the incoming call and create a loop
include => circuitid-inbound
include => circuitid-outbound

Step3: Configure outbound settings

[circuitid-outbound]
exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@circuitid)
exten => _1NXXNXXXXXX,n,Hangup()
exten => _NXXNXXXXXX,1,Dial(SIP/1${EXTEN}@circuitid)
exten => _NXXNXXXXXX,n,Hangup()
exten => _011.,1,Dial(SIP/${EXTEN}@circuitid)
exten => _011.,n,Hangup()
exten => _00.,1,Dial(SIP/${EXTEN}@circuitid)
exten => _00.,n,Hangup()

Step4: Configure Inbound settings

inbound context example for your DID numbers

[circuitid-inbound]
exten => 17863643011,1,Answer() ;your DID

[su_localized_termination_urls] [su_signaling_ips] [su_media_ips]
[su_howto_conclusion text=”Install & Setup Asterisk PBX Server with Circuit ID”]
print
Updated on August 22, 2023

Was this article helpful?

Related Articles