A basic Asterisk v1.8 sip.conf configuration

One of the many goals I set for the students attending my Session Initiation Protocol class, is to leave them with an ability to maintain their own home Asterisk SIP PBX. After all, if you don’t exercise a muscle, it will atrophy; your SIP muscle is no different. It is only by rolling up your shirt sleeves, and diving into the fray, that you can really begin fully understand SIP (and those protocols it is accompanied by… SDP, RTP, DNS, etc).

So, my hope is that this post can take some of the mystery and apprehension out of the initial set up of an Asterisk SIP box. If you do manage to get a stable system, you can use it as a frame of reference for your study of the protocol.

One of the big steps in bringing up a basic Asterisk SIP PBX is the configuration of sip.conf. Therefore, the following configuration is designed to be a cut and paste into the sip.conf file found on an Asterisk v1.8 system (it’ll likely work on other releases as well, I just haven’t tested it to confirm). Doing so will allow you to register four (4) extensions to Asterisk, with After configuring sip.conf, you’ll still need to configure the dialplan in extensions.conf.

The default location for sip.conf on an Ubuntu 10.04 and 12.04 system is:

/etc/asterisk/sip.conf

The configuration file is commented for maximum clarity. Active code appears in bold. If you have any questions, feel free to post a comment, or contact me directly using this site.

Without further adieu…

; basic asterisk v1.8 box
; by r.zachary feeser
; /etc/asterisk/sip.conf
;
;
;

[general]
udpaddr=192.168.1.1   ; set to IP or socket (IP+port) which you’d like Asterisk to listen on
; if the above line is commented out Asterisk will listen on all sockets for SIP traffic

[my_first_phones]
type=friend
contex=zachs_dialplan    ; context to begin at in the dialplan (extensions.conf)
host=dynamic                  ; this device needs to register

disallow=all                      ; need to disallow=all codecs before we can use allow=
allow=ulaw                       ; allow the codec G.711 US
allow=alaw                       ; allow the codec G.711 European

[401](my_first_phones)    ; create SIP UserID 401, with attributes from my_first_phones
secret=secretpass401     ; the password is secretpass401

[402](my_first_phones)    ; create SIP UserID 402, with attributes from my_first_phones
secret=secretpass402     ; the password is secretpass402

[403](my_first_phones)    ; create SIP UserID 403, with attributes from my_first_phones
secret=secretpass403     ; the password is secretpass403

[404](my_first_phones)    ; create SIP UserID 404, with attributes from my_first_phones
secret=secretpass404     ; the password is secretpass404

Previous
Previous

Review – SIP softclient CSipSimple

Next
Next

Get started with Asterisk on Ubuntu 10.04 LTS (first time)