Below is Open Source Asterisk PBX sip.conf configuration example file. Please edit it for your needs. If you need any help then feel free to put your comments.
; This is the sip.conf file for Opensource Asterisk server. Asterisk can be found on ; ; ; http://www.asterisk.org/
;
; More recent versions of this file can be found on: http://www.syednetworks.com/
; SIP Configuration for Asterisk
;
[general]
;disallow=gsm
;allow=ulaw
port = 5060 ; Port to bind to
bindaddr = 0.0.0.0 ; Address to bind to
context = from-sip ; Default for incoming calls
callerid=No CallID
; These register statements are to REGISTER my Asterisk server
; with certain accounts on remote SIP servers. The inoc-dba,
; FWD, and iconnect (deltathree) registries work, the one for
; coloco does not, due to Vocal problems.
;
; These register= statements must be in context [general]
;
; Note that registering against (some?) Vocal 1.4 servers fails. Bug.
;
; All inbound SIP calls end up in context [from-sip] in extensions.conf
; with the extension of the called number as a match pattern
;
; You can have usernames with “@” signs in them, as the line is parsed
; from rear to front (Thanks, Mark!)
;
register=32767:foo@inoc-dba.pch.net/32767
register=14155551212:9876@sipauth.deltathree.com/14155551212
register=11001:pass-da-word@fwd.pulver.com/11001
register=jtodd:wordtopass@iptel.org/1234567
; Other general settings for the SIP channels that are used
;
; tos=['lowdelay', 'throughput', 'reliability', 'mincost', or 'none']
; Sets Type Of Service flags (?)
;
; maxexpirey=3600
; Max duration (seconds) of incoming registration allowed
;
; defaultexpirey=120
; Default length of incoming/outoing registrations
;
;
; Under each peer/user/friend, you can specify some additional notes:
; tos=['lowdelay', 'throughput', 'reliability', 'mincost', or 'none']
; The “iconnect” SIP peer is the outbound leg of the iconnecthere.com
; SIP gateway service. Note that the username and password below
; are different than the “register=” line above. I don’t exactly
; know why iconnecthere.com does it this way, but that’s fine with
; me. I only use the “iconnect” peer below to pass outgoing calls
; to their service. Inbound calls are handled out of [general]
;
; The “dtmfmode=inband” is due to the issues that iconnect seems to
; have with RFC2833 DTMF passing, so I send them the tones. I don’t
; know if this works 100% or not; “untested” as of 2003-04-07.
;
[iconnect]
type=friend
secret=9876
username=52671573
host=sipauth.deltathree.com
dtmfmode=inband
; The “fwd” SIP peer is Free World Dialup, run by Jeff Pulver.
; Personally, I haven’t found much use for it, but other people
; swear by it, so I’ve included it…
;
[fwd]
type=friend
secret=pass-da-word
username=11001
host=fwd.pulver.com
; The “iptel” SIP peer is a service provided by IPTEL.org as a
; SIP directory.
;
[iptel]
type=friend
secret=wordtopass
username=jtodd
host=iptel.org
; The “coloco” SIP peer is a Vocal system at Coloco, Inc. in
; Laurel, MD. They are a SIP gateway provider, and I have
; an account with them for local Maryland SIP dialtone.
; http://www.coloco.com/
;
; This simply dumps calls at a Cisco 3640 via SIP. There
; is no username/password required, since this is simply a
; SIP gateway, and not a proxy. Protection provided by
; ACLs on the router.
;
;
[coloco]
context=coloco
type=friend
host=198.180.62.154
dtmf=rfc2833
; INOC-DBA is a terribly useful SIP-only gateway for
; AS# holders. If you don’t know what an AS# is, and if you
; don’t have one, this config subset won’t be useful to you.
; Contact Woody for an extension assignment.
;
; Note: bogus IP address; get from woody yourself
;
[inoc-dba]
type=friend
host=230.61.218.90
username=32767
secret=yoyoyopassword
; My SIP phones in the house/office are listed below
;
; By my own convention (and to save my sanity) I have given
; all the ATA-186 devices in my network “extensions” that
; are numeric. I picked “2200″ to start for historical
; laziness. Again, for my sanity, I also made the usernames
; on the phone identical to the extension number of the
; channel.
;
; I distribute IP addresses with a DHCP server to these phones,
; on the network 204.91.156.0/24 or behind a NAT (for some)
;
; All the Cisco ATA-186 units I have are on “real” IP addresses,
; and I haven’t experimented with NAT yet. NAT has been a real
; PITA with the ATA’s, and I don’t relish having to make it work.
;
; Anytime a call is dialed from “2203″ or “2204″, it will be
; parsed by the context [intern] in the extensions.conf file
;
; If you want the message waiting light to light up, or stutter
; dialtone, you can set mailbox=[mbox#] - note you can also
; set a comma-delimited list of mailboxes if you want multiples.
;
; You can use “permit=x.x.x.x/yy” lists for hosts that are dynamic
;
; You don’t need to register SIP peers that are static (host=)
;
; Setting “nat=1″ is required to get the “Via:” headers to be configured
; correctly so that the Ciscos (and others?) will re-register when
; they are behind a NAT. If nat=1 is set, it will not harm non-NAT
; connections on the Ciscos, but there are reports of other phones
; pingtel) not working if you have nat=1 set and the phone is not
; behind a NAT.
;
[2203]
type=friend
username=2203
secret=c98wh320e
host=204.91.156.6
mailbox=2203
context=intern
canreinvite=yes
dtmfmode=rfc2833
[2204]
type=friend
username=2204
secret=c82ncc8e9w
mailbox=2203
host=204.91.156.6
context=intern
canreinvite=yes
dtmfmode=rfc2833
[2205]
type=friend
username=2205
secret=nonc282dwa
mailbox=2205
host=dynamic
context=intern
dtmfmode=rfc2833
nat=1
[2206]
type=friend
username=2206
secret=cno2o093
mailbox=2206
host=dynamic
context=intern
canreinvite=yes
nat=1
[2207]
type=friend
username=2207
secret=mhh32c02n
host=dynamic
context=intern
canreinvite=yes
nat=1
Tags: Opensource Asterisk, SIP, SIP gateway, SIP peer, sip.conf