0fb4c8a19a2eb712ef31a6c2c90e224ffc4a7973
[asterisk/asterisk.git] / configs / sip.conf.sample
1 ;
2 ; SIP Configuration for Asterisk
3 ;
4 ; Syntax for specifying a SIP device in extensions.conf is
5 ; SIP/devicename where devicename is defined in a section below.
6 ;
7 ; You may also use 
8 ; SIP/username@domain to call any SIP user on the Internet
9 ; (Don't forget to enable DNS SRV records if you want to use this)
10
11 ; If you define a SIP proxy as a peer below, you may call
12 ; SIP/proxyhostname/user or SIP/user@proxyhostname 
13 ; where the proxyhostname is defined in a section below 
14
15 ; Useful CLI commands to check peers/users:
16 ;   sip show peers              Show all SIP peers (including friends)
17 ;   sip show users              Show all SIP users (including friends)
18 ;   sip show registry           Show status of hosts we register with
19 ;
20 ;   sip debug                   Show all SIP messages
21 ;
22
23 [general]
24 context=default                 ; Default context for incoming calls
25 ;recordhistory=yes              ; Record SIP history by default 
26                                 ; (see sip history / sip no history)
27 ;realm=mydomain.tld             ; Realm for digest authentication
28                                 ; defaults to "asterisk"
29                                 ; Realms MUST be globally unique according to RFC 3261
30                                 ; Set this to your host name or domain name
31 port=5060                       ; UDP Port to bind to (SIP standard port is 5060)
32 bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to all)
33 srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
34                                 ; Note: Asterisk only uses the first host 
35                                 ; in SRV records
36                                 ; Disabling DNS SRV lookups disables the 
37                                 ; ability to place SIP calls based on domain 
38                                 ; names to some other SIP users on the Internet
39                                 
40 ;pedantic=yes                   ; Enable slow, pedantic checking for Pingtel
41                                 ; and multiline formatted headers for strict
42                                 ; SIP compatibility (defaults to "no")
43 ;tos=184                        ; Set IP QoS to either a keyword or numeric val
44 ;tos=lowdelay                   ; lowdelay,throughput,reliability,mincost,none
45 ;maxexpirey=3600                ; Max length of incoming registration we allow
46 ;defaultexpirey=120             ; Default length of incoming/outoing registration
47 ;notifymimetype=text/plain      ; Allow overriding of mime type in MWI NOTIFY
48 ;checkmwi=10                    ; Default time between mailbox checks for peers
49 ;videosupport=yes               ; Turn on support for SIP video
50
51 ;disallow=all                   ; First disallow all codecs
52 ;allow=ulaw                     ; Allow codecs in order of preference
53 ;allow=ilbc                     ; Note: codec order is respected only in [general]
54 ;musicclass=default             ; Sets the default music on hold class for all SIP calls
55                                 ; This may also be set for individual users/peers
56 ;language=en                    ; Default language setting for all users/peers
57                                 ; This may also be set for individual users/peers
58 ;relaxdtmf=yes                  ; Relax dtmf handling
59 ;rtptimeout=60                  ; Terminate call if 60 seconds of no RTP activity
60                                 ; when we're not on hold
61 ;rtpholdtimeout=300             ; Terminate call if 300 seconds of no RTP activity
62                                 ; when we're on hold (must be > rtptimeout)
63 ;trustrpid = no                 ; If Remote-Party-ID should be trusted
64 ;progressinband=no              ; If we should generate in-band ringing always
65                                 ; use 'never' to never use in-band signalling, even in cases
66                                 ; where some buggy devices might not render it
67 ;useragent=Asterisk PBX         ; Allows you to change the user agent string
68 ;nat=no                         ; NAT settings 
69                                 ; yes = Always ignore info and assume NAT
70                                 ; no = Use NAT mode only according to RFC3581 
71                                 ; never = Never attempt NAT mode or RFC3581 support
72                                 ; route = Assume NAT, don't send rport 
73                                 ; (work around more UNIDEN bugs)
74 ;promiscredir = no              ; If yes, allows 302 or REDIR to non-local SIP address
75                                 ; Note that promiscredir when redirects are made to the
76                                 ; local system will cause loops since SIP is incapable
77                                 ; of performing a "hairpin" call.
78 ;dtmfmode = rfc2833             ; Set default dtmfmode for sending DTMF. Default: rfc2833
79                                 ; Other options: 
80                                 ; info : SIP INFO messages
81                                 ; inband : Inband audio
82 ;
83 ; If regcontext is specified, Asterisk will dynamically 
84 ; create and destroy a NoOp priority 1 extension for a given
85 ; peer who registers or unregisters with us.  The actual extension
86 ; is the 'regexten' parameter of the registering peer or its
87 ; name if 'regexten' is not provided.  More than one regexten may be supplied
88 ; if they are separated by '&'.  Patterns may be used in regexten.
89 ;
90 ;regcontext=sipregistrations
91 ;
92 ; Asterisk can register as a SIP user agent to a SIP proxy (provider)
93 ; Format for the register statement is:
94 ;       register => user[:secret[:authuser]]@host[:port][/extension]
95 ;
96 ; If no extension is given, the 's' extension is used. The extension
97 ; needs to be defined in extensions.conf to be able to accept calls
98 ; from this SIP proxy (provider)
99 ;
100 ; host is either a host name defined in DNS or the name of a 
101 ; section defined below.
102 ;
103 ; Examples:
104 ;
105 ;register => 1234:password@mysipprovider.com    
106 ;
107 ;     This will pass incoming calls to the 's' extension
108 ;
109 ;
110 ;register => 2345:password@sip_proxy/1234
111 ;
112 ;    Register 2345 at sip provider 'sip_proxy'.  Calls from this provider connect to local 
113 ;    extension 1234 in extensions.conf default context, unless you define 
114 ;    unless you configure a [sip_proxy] section below, and configure a context.
115 ;        Tip 1: Avoid assigning hostname to a sip.conf section like [provider.com]
116 ;        Tip 2: Use separate type=peer and type=user sections for SIP providers
117 ;                      (instead of type=friend) if you have calls in both directions
118   
119
120 ;externip = 200.201.202.203     ; Address that we're going to put in outbound SIP messages
121                                 ; if we're behind a NAT
122
123                                 ; The externip and localnet is used
124                                 ; when registering and communicating with other proxies
125                                 ; that we're registered with
126                                 ; You may add multiple local networks.  A reasonable set of defaults
127                                 ; are:
128 ;localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks
129 ;localnet=10.0.0.0/255.0.0.0    ; Also RFC1918
130 ;localnet=172.16.0.0/12         ; Another RFC1918 with CIDR notation
131 ;localnet=169.254.0.0/255.255.0.0 ;Zero conf local network
132
133 ;-----------------------------------------------------------------------------------
134 ; Users and peers have different settings available. Friends have all settings,
135 ; since a friend is both a peer and a user
136 ;
137 ; User config options:        Peer configuration:
138 ; --------------------        -------------------
139 ; context                     context
140 ; permit                      permit
141 ; deny                        deny
142 ; auth                        auth
143 ; secret                      secret
144 ; md5secret                   md5secret
145 ; dtmfmode                    dtmfmode
146 ; canreinvite                 canreinvite
147 ; nat                         nat
148 ; callgroup                   callgroup
149 ; pickupgroup                 pickupgroup
150 ; language                    language
151 ; allow                       allow
152 ; disallow                    disallow
153 ; insecure                    insecure
154 ; trustrpid                   trustrpid
155 ; progressinband              progressinband
156 ; promiscredir                promiscredir
157 ; useclientcode               useclientcode
158 ; setvar
159 ; callerid
160 ; accountcode
161 ; amaflags
162 ; incominglimit
163 ; restrictcid
164 ;                             mailbox
165 ;                             username
166 ;                             template
167 ;                             fromdomain
168 ;                             regexten
169 ;                             fromuser
170 ;                             host
171 ;                             mask
172 ;                             port
173 ;                             qualify
174 ;                             defaultip
175 ;                             rtptimeout
176 ;                             rtpholdtimeout
177
178 ;[sip_proxy]
179 ; For incoming calls only. Example: FWD (Free World Dialup)
180 ;type=user
181 ;context=from-fwd
182
183 ;[sip_proxy-out]
184 ;type=peer                      ; we only want to call out, not be called
185 ;secret=guessit
186 ;username=yourusername          ; Authentication user for outbound proxies
187 ;fromuser=yourusername          ; Many SIP providers require this!
188 ;host=box.provider.com
189
190 ;[grandstream1]
191 ;type=friend                    ; either "friend" (peer+user), "peer" or "user"
192 ;context=from-sip
193 ;fromuser=grandstream1          ; overrides the callerid, e.g. required by FWD
194 ;callerid=John Doe <1234>
195 ;host=192.168.0.23              ; we have a static but private IP address
196 ;nat=no                         ; there is not NAT between phone and Asterisk
197 ;canreinvite=yes                ; allow RTP voice traffic to bypass Asterisk
198 ;dtmfmode=info                  ; either RFC2833 or INFO for the BudgeTone
199 ;incominglimit=1                ; permit only 1 outgoing call at a time
200                                 ; from the phone to asterisk
201 ;mailbox=1234@default  ; mailbox 1234 in voicemail context "default"
202 ;disallow=all                   ; need to disallow=all before we can use allow=
203 ;allow=ulaw                     ; Note: In user sections the order of codecs
204                                 ; listed with allow= does NOT matter!
205 ;allow=alaw
206 ;allow=g723.1                   ; Asterisk only supports g723.1 pass-thru!
207 ;allow=g729                     ; Pass-thru only unless g729 license obtained
208
209
210 ;[xlite1]
211 ;Turn off silence suppression in X-Lite ("Transmit Silence"=YES)!
212 ;Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
213 ;type=friend
214 ;regexten=1234                 ; When they register, create extension 1234
215 ;username=xlite1
216 ;callerid="Jane Smith" <5678>
217 ;host=dynamic
218 ;nat=yes                       ; X-Lite is behind a NAT router
219 ;canreinvite=no                ; Typically set to NO if behind NAT
220 ;disallow=all
221 ;allow=gsm                     ; GSM consumes far less bandwidth than ulaw
222 ;allow=ulaw
223 ;allow=alaw
224
225
226 ;[snom]
227 ;type=friend                    ; Friends place calls and receive calls
228 ;context=from-sip               ; Context for incoming calls from this user
229 ;secret=blah
230 ;language=de                    ; Use German prompts for this user 
231 ;host=dynamic                   ; This peer register with us
232 ;dtmfmode=inband                ; Choices are inband, rfc2833, or info
233 ;defaultip=192.168.0.59         ; IP used until peer registers
234 ;username=snom                  ; Username to use in INVITE until peer registers
235 ;mailbox=1234,2345              ; Mailboxes for message waiting indicator
236 ;restrictcid=yes                ; To have the callerid restriced -> sent as ANI
237 ;disallow=all
238 ;allow=ulaw                     ; dtmfmode=inband only works with ulaw or alaw!
239 ;mailbox=1234@context,2345      ; Mailbox(-es) for message waiting indicator
240
241
242 ;[pingtel]
243 ;type=friend
244 ;username=pingtel
245 ;secret=blah
246 ;host=dynamic
247 ;insecure=yes                   ; To match a peer based by IP address only and not peer
248 ;insecure=very                  ; To allow registered hosts to call without re-authenticating
249 ;qualify=1000                   ; Consider it down if it's 1 second to reply
250                                 ; Helps with NAT session
251                                 ; qualify=yes uses default value
252 ;callgroup=1,3-4                ; We are in caller groups 1,3,4
253 ;pickupgroup=1,3-5              ; We can do call pick-p for call group 1,3,4,5
254 ;defaultip=192.168.0.60         ; IP address to use if peer has not registred
255
256 ;[cisco1]
257 ;type=friend
258 ;username=cisco1
259 ;secret=blah
260 ;qualify=200                    ; Qualify peer is no more than 200ms away
261 ;nat=yes                        ; This phone may be natted
262                                 ; Send SIP and RTP to  IP address that packet is 
263                                 ; received from instead of trusting SIP headers 
264 ;host=dynamic                   ; This device registers with us
265 ;canreinvite=no                 ; Asterisk by default tries to redirect the
266                                 ; RTP media stream (audio) to go directly from
267                                 ; the caller to the callee.  Some devices do not
268                                 ; support this (especially if one of them is 
269                                 ; behind a NAT).
270 ;defaultip=192.168.0.4
271
272 ;[cisco2]
273 ;type=friend
274 ;username=cisco2
275 ;fromuser=markster              ; Specify user to put in "from" instead of callerid
276 ;fromdomain=yourdomain.com      ; Specify domain to put in "from" instead of callerid
277                                 ; fromuser and fromdomain are used when Asterisk
278                                 ; places calls to this account.  It is not used for
279                                 ; calls from this account.
280 ;secret=blah
281 ;host=dynamic
282 ;defaultip=192.168.0.4
283 ;amaflags=default               ; Choices are default, omit, billing, documentation
284 ;accountcode=markster           ; Users may be associated with an accountcode to ease billing