BASIC SYSTEM CONFIGURATION

• Two SIP devices: a WiFi phone and a softphone on a laptop

• SIP gateway for calls to the PSTN

• Will be working with sip.conf and extensions.conf

• Simple dial plan:

• softphone (SIP user 101, pw pass), extension 2001

• wifi phone (SIP user 102, pw pass), extension 2002

• echo test, extension 500

• send all other calls to gateway

• inbound calls from the gateway to (+64 4) 4980007 to ring extension 2001

SETUP SIP ENDPOINTS

• Using the Xten X-lite softphone
• Download at http://www.xten.com/index.php?menu=download
• Need to set SIP username and password, and SIP server
• Main Menu > System Settings > SIP Proxy > Default




















X-lite client setup

/etc/asterisk/sip.conf
[general]
context=default ; Default context for incoming calls
port=5060 ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes ; Enable DNS SRV lookups on outbound calls

[101]
type=friend ; both send and receive calls from this peer
host=dynamic  ; this peer will register with us
username=101
secret=pass
canreinvite=no ; don't send SIP re-invites(i.e. terminate rtp stream)
nat=yes ; always assume peer is behind a NAT
context=phones ; send calls to 'phones' context
dtmfmode=rfc2833; set dtmf relay mode
allow=all ; allow all codecs
[102]
type=friend ; both send and receive calls from this peer
host=dynamic; this peer will register with us
username=102
secret=pass
canreinvite=no; don't send SIP re-invites(i.e. terminate rtp stream)
nat=yes; always assume peer is behind a NAT
context=phones; send calls to 'phones' context
dtmfmode=rfc2833; set dtmf relay mode
allow=all; allow all codecs
/etc/asterisk/extensions.conf
[general]
static=yes ; default values for changes to this file
writeprotect=no ; by the Asterisk CLI
[globals]
; variables go here
[default]
; default context

[phones]
; context for our phones
exten => 101,1,Dial(SIP/101)
exten => 102,1,Dial(SIP/102)
exten => 500,1,Answer()
exten => 500,2,Playback(demo-echotest); Let them know what's going on
exten => 500,3,Echo; Do the echo test
exten => 500,4,Playback(demo-echodone); Let them know it's over
exten => 500,5,Hangup
exten => _.,1,Dial(SIP/${EXTEN}@wlg-gateway) ; match anything and send to wlg-gateway
exten => _.,2,Hangup
[from-wlg-gateway]
; context for calls coming from wlg-gateway
exten => 4980007,1,Dial(SIP/2001&SIP/2002)
exten => _.,1,Congestion() ; everyone else gets congestion
extensions.conf split into sections called contexts
[context-name]





















.
Free Web Hosting