
Below is my easiest configuration. I want to learn how to do this from scratch.
Below is the sip.conf
[general]
context=public ; Default context for incoming calls. Defaults to 'default'
allowoverlap=no ; Disable overlap dialing support. (Default is yes)
udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
tcpenable=no ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
transport=udp ; Set the default transports. The order determines the primary default transport.
srvlookup=yes
qualify=yes ; Enable DNS SRV lookups on outbound calls
[authentication]
[basic-options](!) ; a template
dtmfmode=rfc2833
context=from-office
type=friend
[natted-phone](!,basic-options) ; another template inheriting basic-options
directmedia=no
host=dynamic
[public-phone](!,basic-options) ; another template inheriting basic-options
directmedia=yes
[my-codecs](!) ; a template for my preferred codecs
disallow=all
allow=ilbc
allow=g729
allow=gsm
allow=g723
allow=ulaw
[ulaw-phone](!) ; and another one for ulaw-only
disallow=all
allow=ulaw
[101]
type=friend
context=phones
host=dynamic
secret=asterisk
allow=ulaw
[201]
type=friend
context=phones
host=dynamic
secret=asterisk
allow=ulaw
-------------------------------------------------------------------------------------------------------
Below is Extensions.conf
[phones]
exten => 101,1,NoOp(first line)
exten => 101,2,NoOp(second line)
exten => 101,3,Dial(SIP/201)
exten => 101,4,Hangup
exten => 201,1,NoOp(first line)
exten => 201,2,NoOp(second line)
exten => 201,3,Dial(SIP/101)
exten => 201,4,Hangup
-----------------------------------------------------------------------------------------------------------
Output from sip show peers
asterisksystem*CLI> sip show peers
Name/username Host Dyn Forcerport ACL Port Status Description
101/101 10.0.0.2 D a 52848 OK (107 ms)
201/201 10.0.0.4 D a 5060 OK (14 ms)
2 sip peers [Monitored: 2 online, 0 offline Unmonitored: 0 online, 0 offline]
asterisksystem*CLI>
----------------------------------------------------------------------------------------------------------------------
Below is the out put when i dial from my polycom soundpoint 330 phone which is extension 201 to xlite extension 101.
When i dial extension 201 from the xlite the polycom phone does not ring, and vice-versa. But it shows on the output below.
== Using SIP RTP CoS mark 5
-- Executing [101@phones:1] NoOp("SIP/201-00000004", "call for line two") in new stack
-- Executing [101@phones:2] Dial("SIP/201-00000004", "SIP/201") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/201
-- SIP/201-00000005 is ringing
== Spawn extension (phones, 101, 2) exited non-zero on 'SIP/201-00000004'
asterisksystem*CLI>