Wednesday, November 5, 2014

how to setup VoIP server, asterisk

1- install asterisk
root@voip-server# apt-get install asterisk

2- create sip account by adding the following line to /etc/asterisk/sip.conf
[voip1](!)
type=friend
host=dynamic
context=inside-context
disallow=all
allow=ulaw

[user1](voip1)
secret=pass1

[user2](voip1)
secret=pass2

3- create dialplan extentions by adding the following line to /etc/asterisk/extensions.conf  (to call user1 use extension 6001 and extention 6002 to call user2)

[inside-context]
exten=>6001,1,Dial(SIP/user1,20)
exten=>6002,1,Dial(SIP/user2,20)

4- use asterisk commandline to verify configuration

root@voip-server:/etc/asterisk# asterisk -r -c
Asterisk 1.8.13.1~dfsg-3, Copyright (C) 1999 - 2012 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
[ Booting...
[ Reading Master Configuration ]
[ Initializing Custom Configuration Options ]
Connected to Asterisk 1.8.13.1~dfsg-3 currently running on deb1-cln-voip2 (pid = 10425)
voip-server*CLI>  sip show peers
Name/username              Host                                    Dyn Forcerport ACL Port     Status    
user1/user1                192.168.202.23                           D   N             5060     Unmonitored
user2/user2                192.168.202.3                            D   N             5060     Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline]
voip-server*CLI>  dialplan show inside-context
[ Context 'inside-context' created by 'pbx_config' ]
  '6001' =>         1. Dial(SIP/user1,20)                         [pbx_config]
  '6002' =>         1. Dial(SIP/user2,20)                         [pbx_config]

-= 2 extensions (2 priorities) in 1 context. =-

4- client configuration example using microsip


5- testing calling



No comments:

Post a Comment