Posted On March 29, 2019

How to set up Sip Trunk between two offices

kimconnect 0 comments
blog.KimConnect.com >> Windows >> How to set up Sip Trunk between two offices
1. Set up two Asterisk machines: Asterisk1 & Asterisk2
Example for Ubuntu:
vim /etc/network/interfaces
configure static ip address
/etc/init.d/networking restart
2. Log onto Asterisk1
vim /etc/asterisk/sip.conf
———– contents ——————–
[asterisk2]
type=friend
host={ip_address_of_asterisk2}
context=internal
insecure=invite (this is so that authentication is basing only on IP)
allow=all (or g729 codec only)
[1000]
type=friend
host=dynamic
context=internal
allow=all
secret={someComplexPasswordHere}
———————————————-
vim /etc/asterisk/extensions.conf
———– contents ——————–
[internal]
ext => 2000,1,dial(SIP/2000)
ext => 2000,n,Hangup()
exten => _1XXX,1,Dial(SIP/${EXTEN}@asterisk1)              (underscore meaning wildcards; {EXTEN} means any extension at asterisk2 server)
exten => _1XXX,n,hangup()
———————————————-
3. Log onto Asterisk2
vim /etc/asterisk/sip.conf
———– contents ——————–
[asterisk2]
type=friend
host={ip_address_of_asterisk1}
context=internal
insecure=invite (this is so that authentication is basing only on IP)
allow=all (or g729 codec only)
[2000]
type=friend
host=dynamic
context=internal
allow=all
secret={someComplexPasswordHere}
———————————————-
vim /etc/asterisk/extensions.conf
———– contents ——————–
[internal]
ext => 2000,1,dial(SIP/2000)
ext => 2000,n,Hangup()
exten => _1XXX,1,Dial(SIP/${EXTEN}@asterisk1)
exten => _1XXX,n,hangup()
———————————————-
4. Test
Use any SIP capable phone such as:
Blink
Ekiga
Commands for troubleshooting:
cat /etc/asterisk/extensions.conf  (cat command to read contents of file)
cat /etc/asterisk/sip.conf
asterisk (start asterisk)
asterisk -r (reload asterisk settings)
sip reload (reload sip.conf)
dialplan reload (reload extensions.conf)
sip show users (show connected users)
sip show peers (to show all phones that are registered)
dialplan show (show dial plans)

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Active Directory GPO Practical Examples

Fonts Distribution---------------------------------A. Create an SMB share on an Intranet accessible directory \\SOFTWARE\FONTS\Kim-Connect.ttfB. Create a new…

PowerShell: Set Auto Logon

Instead of running the GUI method (netplwiz), there's a more efficient way to set auto…

Strategies to Free Up Disk Space C:\ Drive

1. Move pagefile away from system drive (optional) 2. Turn off System Restore (warning; this…
Other project: DragonCoin.com