Lil' bit more documentation to keep folks happy.
[asterisk/asterisk.git] / configs / sip.conf.sample
1 ;
2 ; SIP Configuration example 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 set debug               Show all SIP messages
21 ;
22 ;   sip reload                  Reload configuration file
23 ;                               Active SIP peers will not be reconfigured
24 ;
25
26 [general]
27 context=default                 ; Default context for incoming calls
28 ;allowguest=no                  ; Allow or reject guest calls (default is yes)
29 ;match_auth_username=yes        ; if available, match user entry using the
30                                 ; 'username' field from the authentication line
31                                 ; instead of the From: field.
32                                 
33 allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
34 ;allowtransfer=no               ; Disable all transfers (unless enabled in peers or users)
35                                 ; Default is enabled
36 ;realm=mydomain.tld             ; Realm for digest authentication
37                                 ; defaults to "asterisk". If you set a system name in
38                                 ; asterisk.conf, it defaults to that system name
39                                 ; Realms MUST be globally unique according to RFC 3261
40                                 ; Set this to your host name or domain name
41 bindport=5060                   ; UDP Port to bind to (SIP standard port is 5060)
42                                 ; bindport is the local UDP port that Asterisk will listen on
43 bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to all)
44 srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
45                                 ; Note: Asterisk only uses the first host 
46                                 ; in SRV records
47                                 ; Disabling DNS SRV lookups disables the 
48                                 ; ability to place SIP calls based on domain 
49                                 ; names to some other SIP users on the Internet
50                                 
51 ;domain=mydomain.tld            ; Set default domain for this host
52                                 ; If configured, Asterisk will only allow
53                                 ; INVITE and REFER to non-local domains
54                                 ; Use "sip show domains" to list local domains
55 ;pedantic=yes                   ; Enable checking of tags in headers, 
56                                 ; international character conversions in URIs
57                                 ; and multiline formatted headers for strict
58                                 ; SIP compatibility (defaults to "no")
59
60 ; See doc/qos.tex for a description of these parameters.
61 ;tos_sip=cs3                    ; Sets TOS for SIP packets.
62 ;tos_audio=ef                   ; Sets TOS for RTP audio packets.
63 ;tos_video=af41                 ; Sets TOS for RTP video packets.
64 ;tos_text=af41                  ; Sets TOS for RTP text packets.
65
66 ;cos_sip=4                      ; Sets CoS for SIP packets.
67 ;cos_audio=6                    ; Sets CoS for RTP audio packets.
68 ;cos_video=5                    ; Sets CoS for RTP video packets.
69 ;cos_text=0                     ; Sets CoS for RTP text packets.
70
71 ;maxexpiry=3600                 ; Maximum allowed time of incoming registrations
72                                 ; and subscriptions (seconds)
73 ;minexpiry=60                   ; Minimum length of registrations/subscriptions (default 60)
74 ;defaultexpiry=120              ; Default length of incoming/outgoing registration
75 ;t1min=100                      ; Minimum roundtrip time for messages to monitored hosts
76                                 ; Defaults to 100 ms
77 ;notifymimetype=text/plain      ; Allow overriding of mime type in MWI NOTIFY
78 ;buggymwi=no                    ; Cisco SIP firmware doesn't support the MWI RFC
79                                 ; fully. Enable this option to not get error messages
80                                 ; when sending MWI to phones with this bug.
81 ;vmexten=voicemail              ; dialplan extension to reach mailbox sets the 
82                                 ; Message-Account in the MWI notify message 
83                                 ; defaults to "asterisk"
84 ;disallow=all                   ; First disallow all codecs
85 ;allow=ulaw                     ; Allow codecs in order of preference
86 ;allow=ilbc                     ; see doc/rtp-packetization for framing options
87 ;
88 ; This option specifies a preference for which music on hold class this channel
89 ; should listen to when put on hold if the music class has not been set on the
90 ; channel with Set(CHANNEL(musicclass)=whatever) in the dialplan, and the peer
91 ; channel putting this one on hold did not suggest a music class.
92 ;
93 ; This option may be specified globally, or on a per-user or per-peer basis.
94 ;
95 ;mohinterpret=default
96 ;
97 ; This option specifies which music on hold class to suggest to the peer channel
98 ; when this channel places the peer on hold. It may be specified globally or on
99 ; a per-user or per-peer basis.
100 ;
101 ;mohsuggest=default
102 ;
103 ;language=en                    ; Default language setting for all users/peers
104                                 ; This may also be set for individual users/peers
105 ;relaxdtmf=yes                  ; Relax dtmf handling
106 ;trustrpid = no                 ; If Remote-Party-ID should be trusted
107 ;sendrpid = yes                 ; If Remote-Party-ID should be sent
108 ;progressinband=never           ; If we should generate in-band ringing always
109                                 ; use 'never' to never use in-band signalling, even in cases
110                                 ; where some buggy devices might not render it
111                                 ; Valid values: yes, no, never Default: never
112 ;useragent=Asterisk PBX         ; Allows you to change the user agent string
113                                 ; The default user agent string also contains the Asterisk
114                                 ; version. If you don't want to expose this, change the
115                                 ; useragent string.
116 ;promiscredir = no              ; If yes, allows 302 or REDIR to non-local SIP address
117                                 ; Note that promiscredir when redirects are made to the
118                                 ; local system will cause loops since Asterisk is incapable
119                                 ; of performing a "hairpin" call.
120 ;usereqphone = no               ; If yes, ";user=phone" is added to uri that contains
121                                 ; a valid phone number
122 ;dtmfmode = rfc2833             ; Set default dtmfmode for sending DTMF. Default: rfc2833
123                                 ; Other options: 
124                                 ; info : SIP INFO messages
125                                 ; inband : Inband audio (requires 64 kbit codec -alaw, ulaw)
126                                 ; auto : Use rfc2833 if offered, inband otherwise
127
128 ;compactheaders = yes           ; send compact sip headers.
129 ;
130 ;videosupport=yes               ; Turn on support for SIP video. You need to turn this on
131                                 ; in the this section to get any video support at all.
132                                 ; You can turn it off on a per peer basis if the general
133                                 ; video support is enabled, but you can't enable it for
134                                 ; one peer only without enabling in the general section.
135 ;maxcallbitrate=384             ; Maximum bitrate for video calls (default 384 kb/s)
136                                 ; Videosupport and maxcallbitrate is settable
137                                 ; for peers and users as well
138 ;callevents=no                  ; generate manager events when sip ua 
139                                 ; performs events (e.g. hold)
140 ;alwaysauthreject = yes         ; When an incoming INVITE or REGISTER is to be rejected,
141                                 ; for any reason, always reject with '401 Unauthorized'
142                                 ; instead of letting the requester know whether there was
143                                 ; a matching user or peer for their request
144
145 ;g726nonstandard = yes          ; If the peer negotiates G726-32 audio, use AAL2 packing
146                                 ; order instead of RFC3551 packing order (this is required
147                                 ; for Sipura and Grandstream ATAs, among others). This is
148                                 ; contrary to the RFC3551 specification, the peer _should_
149                                 ; be negotiating AAL2-G726-32 instead :-(
150 ;outboundproxy=proxy.provider.domain           ; send outbound signaling to this proxy, not directly to the devices
151 ;outboundproxy=proxy.provider.domain:8080       ; send outbound signaling to this proxy, not directly to the devices
152 ;outboundproxy=proxy.provider.domain,force      ; Send ALL outbound signalling to proxy, ignoring route: headers
153 ;matchexterniplocally = yes     ; Only substitute the externip or externhost setting if it matches
154                                 ; your localnet setting. Unless you have some sort of strange network
155                                 ; setup you will not need to enable this.
156
157 ;
158 ; If regcontext is specified, Asterisk will dynamically create and destroy a
159 ; NoOp priority 1 extension for a given peer who registers or unregisters with
160 ; us and have a "regexten=" configuration item.  
161 ; Multiple contexts may be specified by separating them with '&'. The 
162 ; actual extension is the 'regexten' parameter of the registering peer or its
163 ; name if 'regexten' is not provided.  If more than one context is provided,
164 ; the context must be specified within regexten by appending the desired
165 ; context after '@'.  More than one regexten may be supplied if they are 
166 ; separated by '&'.  Patterns may be used in regexten.
167 ;
168 ;regcontext=sipregistrations
169 ;regextenonqualify=yes          ; Default "no"
170                                 ; If you have qualify on and the peer becomes unreachable
171                                 ; this setting will enforce inactivation of the regexten
172                                 ; extension for the peer
173 ;
174 ;--------------------------- RTP timers ----------------------------------------------------
175 ; These timers are currently used for both audio and video streams. The RTP timeouts
176 ; are only applied to the audio channel.
177 ; The settings are settable in the global section as well as per device
178 ;
179 ;rtptimeout=60                  ; Terminate call if 60 seconds of no RTP or RTCP activity
180                                 ; on the audio channel
181                                 ; when we're not on hold. This is to be able to hangup
182                                 ; a call in the case of a phone disappearing from the net,
183                                 ; like a powerloss or grandma tripping over a cable.
184 ;rtpholdtimeout=300             ; Terminate call if 300 seconds of no RTP or RTCP activity
185                                 ; on the audio channel
186                                 ; when we're on hold (must be > rtptimeout)
187 ;rtpkeepalive=<secs>            ; Send keepalives in the RTP stream to keep NAT open
188                                 ; (default is off - zero)
189 ;--------------------------- SIP DEBUGGING ---------------------------------------------------
190 ;sipdebug = yes                 ; Turn on SIP debugging by default, from
191                                 ; the moment the channel loads this configuration
192 ;recordhistory=yes              ; Record SIP history by default 
193                                 ; (see sip history / sip no history)
194 ;dumphistory=yes                ; Dump SIP history at end of SIP dialogue
195                                 ; SIP history is output to the DEBUG logging channel
196
197
198 ;--------------------------- STATUS NOTIFICATIONS (SUBSCRIPTIONS) ----------------------------
199 ; You can subscribe to the status of extensions with a "hint" priority
200 ; (See extensions.conf.sample for examples)
201 ; chan_sip support two major formats for notifications: dialog-info and SIMPLE 
202 ;
203 ; You will get more detailed reports (busy etc) if you have a call limit set
204 ; for a device. When the call limit is filled, we will indicate busy. Note that
205 ; you need at least 2 in order to be able to do attended transfers.
206 ;
207 ; If you set the busy-level in addition to the call limit, we will indicate busy
208 ; when we have a number of calls that matches busy-level, but still allow calls
209 ; up to the call-limit. This allows for transfers while still having blinking
210 ; lamps and queues understanding that a device is busy.
211 ;
212 ; For queues, you will need this level of detail in status reporting, regardless
213 ; if you use SIP subscriptions. Queues and manager use the same internal interface
214 ; for reading status information.
215 ;
216 ; Note: Subscriptions does not work if you have a realtime dialplan and use the
217 ; realtime switch.
218 ;
219 ;allowsubscribe=no              ; Disable support for subscriptions. (Default is yes)
220 ;subscribecontext = default     ; Set a specific context for SUBSCRIBE requests
221                                 ; Useful to limit subscriptions to local extensions
222                                 ; Settable per peer/user also
223 ;notifyringing = yes            ; Notify subscriptions on RINGING state (default: no)
224 ;notifyhold = yes               ; Notify subscriptions on HOLD state (default: no)
225                                 ; Turning on notifyringing and notifyhold will add a lot
226                                 ; more database transactions if you are using realtime.
227 ;limitonpeer = yes              ; Apply call limits on peers only. This will improve 
228                                 ; status notification when you are using type=friend
229                                 ; Inbound calls, that really apply to the user part
230                                 ; of a friend will now be added to and compared with
231                                 ; the peer limit instead of applying two call limits,
232                                 ; one for the peer and one for the user.
233
234 ;----------------------------------------- T.38 FAX PASSTHROUGH SUPPORT -----------------------
235 ;
236 ; This setting is available in the [general] section as well as in device configurations.
237 ; Setting this to yes, enables T.38 fax (UDPTL) passthrough on SIP to SIP calls, provided
238 ; both parties have T38 support enabled in their Asterisk configuration 
239 ; This has to be enabled in the general section for all devices to work. You can then
240 ; disable it on a per device basis. 
241 ;
242 ; T.38 faxing only works in SIP to SIP calls, with no local or agent channel being used.
243 ;
244 ; t38pt_udptl = yes            ; Default false
245 ;
246 ;----------------------------------------- OUTBOUND SIP REGISTRATIONS  ------------------------
247 ; Asterisk can register as a SIP user agent to a SIP proxy (provider)
248 ; Format for the register statement is:
249 ;       register => user[:secret[:authuser]]@host[:port][/extension]
250 ;
251 ; If no extension is given, the 's' extension is used. The extension needs to
252 ; be defined in extensions.conf to be able to accept calls from this SIP proxy
253 ; (provider).
254 ;
255 ; host is either a host name defined in DNS or the name of a section defined
256 ; below.
257 ;
258 ; A similar effect can be achieved by adding a "callbackextension" option in a peer section.
259 ; this is equivalent to having the following line in the general section:
260 ;
261 ;       register => username:secret@host/callbackextension
262 ;
263 ; and more readable because you don't have to write the parameters in two places
264 ; (note that the "port" is ignored - this is a bug that should be fixed).
265 ;
266 ; Examples:
267 ;
268 ;register => 1234:password@mysipprovider.com    
269 ;
270 ;     This will pass incoming calls to the 's' extension
271 ;
272 ;
273 ;register => 2345:password@sip_proxy/1234
274 ;
275 ;    Register 2345 at sip provider 'sip_proxy'.  Calls from this provider
276 ;    connect to local extension 1234 in extensions.conf, default context,
277 ;    unless you configure a [sip_proxy] section below, and configure a
278 ;    context.
279 ;    Tip 1: Avoid assigning hostname to a sip.conf section like [provider.com]
280 ;    Tip 2: Use separate type=peer and type=user sections for SIP providers
281 ;           (instead of type=friend) if you have calls in both directions
282   
283 ;registertimeout=20             ; retry registration calls every 20 seconds (default)
284 ;registerattempts=10            ; Number of registration attempts before we give up
285                                 ; 0 = continue forever, hammering the other server
286                                 ; until it accepts the registration
287                                 ; Default is 0 tries, continue forever
288
289 ;----------------------------------------- NAT SUPPORT ------------------------
290 ;
291 ; WARNING: SIP operation behind a NAT is tricky and you really need
292 ; to read and understand well the following section.
293 ;
294 ; When Asterisk is behind a NAT device, the "local" address (and port) that
295 ; a socket is bound to has different values when seen from the inside or
296 ; from the outside of the NATted network. Unfortunately this address must
297 ; be communicated to the outside (e.g. in SIP and SDP messages), and in
298 ; order to determine the correct value Asterisk needs to know:
299 ;
300 ; + whether it is talking to someone "inside" or "outside" of the NATted network.
301 ;   This is configured by assigning the "localnet" parameter with a list
302 ;   of network addresses that are considered "inside" of the NATted network.
303 ;   IF LOCALNET IS NOT SET, THE EXTERNAL ADDRESS WILL NOT BE SET CORRECTLY.
304 ;   Multiple entries are allowed, e.g. a reasonable set is the following:
305 ;
306 ;      localnet=192.168.0.0/255.255.0.0 ; RFC 1918 addresses
307 ;      localnet=10.0.0.0/255.0.0.0      ; Also RFC1918
308 ;      localnet=172.16.0.0/12           ; Another RFC1918 with CIDR notation
309 ;      localnet=169.254.0.0/255.255.0.0 ; Zero conf local network
310 ;
311 ; + the "externally visible" address and port number to be used when talking
312 ;   to a host outside the NAT. This information is derived by one of the
313 ;   following (mutually exclusive) config file parameters:
314 ;
315 ;   a. "externip = hostname[:port]" specifies a static address[:port] to
316 ;      be used in SIP and SDP messages.
317 ;      The hostname is looked up only once, when [re]loading sip.conf .
318 ;      If a port number is not present, use the "bindport" value (which is
319 ;      not guaranteed to work correctly, because a NAT box might remap the
320 ;      port number as well as the address).
321 ;      This approach can be useful if you have a NAT device where you can
322 ;      configure the mapping statically. Examples:
323 ;
324 ;       externip = 12.34.56.78          ; use this address.
325 ;       externip = 12.34.56.78:9900     ; use this address and port.
326 ;       externip = mynat.my.org:12600   ; Public address of my nat box.
327 ;
328 ;   b. "externhost = hostname[:port]" is similar to "externip" except
329 ;      that the hostname is looked up every "externrefresh" seconds
330 ;      (default 10s). This can be useful when your NAT device lets you choose
331 ;      the port mapping, but the IP address is dynamic.
332 ;      Beware, you might suffer from service disruption when the name server
333 ;      resolution fails. Examples:
334 ;
335 ;       externhost=foo.dyndns.net       ; refreshed periodically
336 ;       externrefresh=180               ; change the refresh interval
337 ;
338 ;   c. "stunaddr = stun.server[:port]" queries the STUN server specified
339 ;      as an argument to obtain the external address/port.
340 ;      Queries are also sent periodically every "externrefresh" seconds
341 ;      (as a side effect, sending the query also acts as a keepalive for
342 ;      the state entry on the nat box):
343 ;
344 ;       stunaddr = foo.stun.com:3478
345 ;       externrefresh = 15
346 ;
347 ;   Note that at the moment all these mechanism work only for the SIP socket.
348 ;   The IP address discovered with externip/externhost/STUN is reused for
349 ;   media sessions as well, but the port numbers are not remapped so you
350 ;   may still experience problems.
351 ;
352 ; NOTE 1: in some cases, NAT boxes will use different port numbers in
353 ; the internal<->external mapping. In these cases, the "externip" and
354 ; "externhost" might not help you configure addresses properly, and you
355 ; really need to use STUN.
356 ;
357 ; NOTE 2: when using "externip" or "externhost", the address part is
358 ; also used as the external address for media sessions.
359 ; If you use "stunaddr", STUN queries will be sent to the same server
360 ; also from media sockets, and this should permit a correct mapping of
361 ; the port numbers as well.
362 ;
363 ; In addition to the above, Asterisk has an additional "nat" parameter to
364 ; address NAT-related issues in incoming SIP or media sessions.
365 ; In particular, depending on the 'nat= ' settings described below, Asterisk
366 ; may override the address/port information specified in the SIP/SDP messages,
367 ; and use the information (sender address) supplied by the network stack instead.
368 ; However, this is only useful if the external traffic can reach us.
369 ; The following settings are allowed (both globally and in individual sections):
370 ;
371 ;       nat = no                ; default. Use NAT mode only according to RFC3581 (;rport)
372 ;       nat = yes               ; Always ignore info and assume NAT
373 ;       nat = never             ; Never attempt NAT mode or RFC3581 support
374 ;       nat = route             ; route = Assume NAT, don't send rport 
375 ;                               ; (work around more UNIDEN bugs)
376
377 ;----------------------------------- MEDIA HANDLING --------------------------------
378 ; By default, Asterisk tries to re-invite the audio to an optimal path. If there's
379 ; no reason for Asterisk to stay in the media path, the media will be redirected.
380 ; This does not really work with in the case where Asterisk is outside and have
381 ; clients on the inside of a NAT. In that case, you want to set canreinvite=nonat
382 ;
383 ;canreinvite=yes                ; Asterisk by default tries to redirect the
384                                 ; RTP media stream (audio) to go directly from
385                                 ; the caller to the callee.  Some devices do not
386                                 ; support this (especially if one of them is behind a NAT).
387                                 ; The default setting is YES. If you have all clients
388                                 ; behind a NAT, or for some other reason wants Asterisk to
389                                 ; stay in the audio path, you may want to turn this off.
390
391                                 ; This setting also affect direct RTP
392                                 ; at call setup (a new feature in 1.4 - setting up the
393                                 ; call directly between the endpoints instead of sending
394                                 ; a re-INVITE).
395
396 ;directrtpsetup=yes             ; Enable the new experimental direct RTP setup. This sets up
397                                 ; the call directly with media peer-2-peer without re-invites.
398                                 ; Will not work for video and cases where the callee sends 
399                                 ; RTP payloads and fmtp headers in the 200 OK that does not match the
400                                 ; callers INVITE. This will also fail if canreinvite is enabled when
401                                 ; the device is actually behind NAT.
402
403 ;canreinvite=nonat              ; An additional option is to allow media path redirection
404                                 ; (reinvite) but only when the peer where the media is being
405                                 ; sent is known to not be behind a NAT (as the RTP core can
406                                 ; determine it based on the apparent IP address the media
407                                 ; arrives from).
408
409 ;canreinvite=update             ; Yet a third option... use UPDATE for media path redirection,
410                                 ; instead of INVITE. This can be combined with 'nonat', as
411                                 ; 'canreinvite=update,nonat'. It implies 'yes'.
412
413 ;----------------------------------------- REALTIME SUPPORT ------------------------
414 ; For additional information on ARA, the Asterisk Realtime Architecture,
415 ; please read realtime.txt and extconfig.txt in the /doc directory of the
416 ; source code.
417 ;
418 ;rtcachefriends=yes             ; Cache realtime friends by adding them to the internal list
419                                 ; just like friends added from the config file only on a
420                                 ; as-needed basis? (yes|no)
421
422 ;rtsavesysname=yes              ; Save systemname in realtime database at registration
423                                 ; Default= no
424
425 ;rtupdate=yes                   ; Send registry updates to database using realtime? (yes|no)
426                                 ; If set to yes, when a SIP UA registers successfully, the ip address,
427                                 ; the origination port, the registration period, and the username of
428                                 ; the UA will be set to database via realtime. 
429                                 ; If not present, defaults to 'yes'.
430 ;rtautoclear=yes                ; Auto-Expire friends created on the fly on the same schedule
431                                 ; as if it had just registered? (yes|no|<seconds>)
432                                 ; If set to yes, when the registration expires, the friend will
433                                 ; vanish from the configuration until requested again. If set
434                                 ; to an integer, friends expire within this number of seconds
435                                 ; instead of the registration interval.
436
437 ;ignoreregexpire=yes            ; Enabling this setting has two functions:
438                                 ;
439                                 ; For non-realtime peers, when their registration expires, the
440                                 ; information will _not_ be removed from memory or the Asterisk database
441                                 ; if you attempt to place a call to the peer, the existing information
442                                 ; will be used in spite of it having expired
443                                 ;
444                                 ; For realtime peers, when the peer is retrieved from realtime storage,
445                                 ; the registration information will be used regardless of whether
446                                 ; it has expired or not; if it expires while the realtime peer 
447                                 ; is still in memory (due to caching or other reasons), the 
448                                 ; information will not be removed from realtime storage
449
450 ;----------------------------------------- SIP DOMAIN SUPPORT ------------------------
451 ; Incoming INVITE and REFER messages can be matched against a list of 'allowed'
452 ; domains, each of which can direct the call to a specific context if desired.
453 ; By default, all domains are accepted and sent to the default context or the
454 ; context associated with the user/peer placing the call.
455 ; Domains can be specified using:
456 ; domain=<domain>[,<context>]
457 ; Examples:
458 ; domain=myasterisk.dom
459 ; domain=customer.com,customer-context
460 ;
461 ; In addition, all the 'default' domains associated with a server should be
462 ; added if incoming request filtering is desired.
463 ; autodomain=yes
464 ;
465 ; To disallow requests for domains not serviced by this server:
466 ; allowexternaldomains=no
467
468 ;domain=mydomain.tld,mydomain-incoming
469                                 ; Add domain and configure incoming context
470                                 ; for external calls to this domain
471 ;domain=1.2.3.4                 ; Add IP address as local domain
472                                 ; You can have several "domain" settings
473 ;allowexternalinvites=no        ; Disable INVITE and REFER to non-local domains
474                                 ; Default is yes
475 ;autodomain=yes                 ; Turn this on to have Asterisk add local host
476                                 ; name and local IP to domain list.
477
478 ; fromdomain=mydomain.tld       ; When making outbound SIP INVITEs to
479                                 ; non-peers, use your primary domain "identity"
480                                 ; for From: headers instead of just your IP
481                                 ; address. This is to be polite and
482                                 ; it may be a mandatory requirement for some
483                                 ; destinations which do not have a prior
484                                 ; account relationship with your server. 
485
486 ;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
487 ; jbenable = yes              ; Enables the use of a jitterbuffer on the receiving side of a
488                               ; SIP channel. Defaults to "no". An enabled jitterbuffer will
489                               ; be used only if the sending side can create and the receiving
490                               ; side can not accept jitter. The SIP channel can accept jitter,
491                               ; thus a jitterbuffer on the receive SIP side will be used only
492                               ; if it is forced and enabled.
493
494 ; jbforce = no                ; Forces the use of a jitterbuffer on the receive side of a SIP
495                               ; channel. Defaults to "no".
496
497 ; jbmaxsize = 200             ; Max length of the jitterbuffer in milliseconds.
498
499 ; jbresyncthreshold = 1000    ; Jump in the frame timestamps over which the jitterbuffer is
500                               ; resynchronized. Useful to improve the quality of the voice, with
501                               ; big jumps in/broken timestamps, usually sent from exotic devices
502                               ; and programs. Defaults to 1000.
503
504 ; jbimpl = fixed              ; Jitterbuffer implementation, used on the receiving side of a SIP
505                               ; channel. Two implementations are currently available - "fixed"
506                               ; (with size always equals to jbmaxsize) and "adaptive" (with
507                               ; variable size, actually the new jb of IAX2). Defaults to fixed.
508
509 ; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
510 ;-----------------------------------------------------------------------------------
511
512 [authentication]
513 ; Global credentials for outbound calls, i.e. when a proxy challenges your
514 ; Asterisk server for authentication. These credentials override
515 ; any credentials in peer/register definition if realm is matched.
516 ;
517 ; This way, Asterisk can authenticate for outbound calls to other
518 ; realms. We match realm on the proxy challenge and pick an set of 
519 ; credentials from this list
520 ; Syntax:
521 ;       auth = <user>:<secret>@<realm>
522 ;       auth = <user>#<md5secret>@<realm>
523 ; Example:
524 ;auth=mark:topsecret@digium.com
525
526 ; You may also add auth= statements to [peer] definitions 
527 ; Peer auth= override all other authentication settings if we match on realm
528
529 ;------------------------------------------------------------------------------
530 ; Users and peers have different settings available. Friends have all settings,
531 ; since a friend is both a peer and a user
532 ;
533 ; User config options:        Peer configuration:
534 ; --------------------        -------------------
535 ; context                     context
536 ; callingpres                 callingpres
537 ; permit                      permit
538 ; deny                        deny
539 ; secret                      secret
540 ; md5secret                   md5secret
541 ; dtmfmode                    dtmfmode
542 ; canreinvite                 canreinvite
543 ; nat                         nat
544 ; callgroup                   callgroup
545 ; pickupgroup                 pickupgroup
546 ; language                    language
547 ; allow                       allow
548 ; disallow                    disallow
549 ; insecure                    insecure
550 ; trustrpid                   trustrpid
551 ; progressinband              progressinband
552 ; promiscredir                promiscredir
553 ; useclientcode               useclientcode
554 ; accountcode                 accountcode
555 ; setvar                      setvar
556 ; callerid                    callerid
557 ; amaflags                    amaflags
558 ; call-limit                  call-limit
559 ; allowoverlap                allowoverlap
560 ; allowsubscribe              allowsubscribe
561 ; allowtransfer               allowtransfer
562 ; subscribecontext            subscribecontext
563 ; videosupport                videosupport
564 ; maxcallbitrate              maxcallbitrate
565 ; rfc2833compensate           mailbox
566 ;                             busy-level
567 ;                             username
568 ;                             template
569 ;                             fromdomain
570 ;                             regexten
571 ;                             fromuser
572 ;                             host
573 ;                             port
574 ;                             qualify
575 ;                             defaultip
576 ;                             rtptimeout
577 ;                             rtpholdtimeout
578 ;                             sendrpid
579 ;                             outboundproxy
580 ;                             rfc2833compensate
581 ;                             callbackextension
582 ;                             registertrying
583
584 ;[sip_proxy]
585 ; For incoming calls only. Example: FWD (Free World Dialup)
586 ; We match on IP address of the proxy for incoming calls 
587 ; since we can not match on username (caller id)
588 ;type=peer
589 ;context=from-fwd
590 ;host=fwd.pulver.com
591
592 ;[sip_proxy-out]
593 ;type=peer                              ; we only want to call out, not be called
594 ;secret=guessit
595 ;username=yourusername                  ; Authentication user for outbound proxies
596 ;fromuser=yourusername                  ; Many SIP providers require this!
597 ;fromdomain=provider.sip.domain 
598 ;host=box.provider.com
599 ;usereqphone=yes                        ; This provider requires ";user=phone" on URI
600 ;call-limit=5                           ; permit only 5 simultaneous outgoing calls to this peer
601                                         ; Call-limits will not be enforced on real-time peers,
602                                         ; since they are not stored in-memory
603 ;busy-level=2                           ; Signal busy at 2 or more calls
604 ;outboundproxy=proxy.provider.domain    ; send outbound signaling to this proxy, not directly to the peer
605 ;port=80                                ; The port number we want to connect to on the remote side
606                                         ; Also used as "defaultport" in combination with "defaultip" settings
607
608 ;--- sample definition for a provider
609 ;[provider1]
610 ;type=peer
611 ;host=sip.provider1.com
612 ;username=4015552299            ; how your provider knows you
613 ;secret=youwillneverguessit
614 ;callbackextension=123          ; Register with this server and require calls coming back to this extension
615
616 ;------------------------------------------------------------------------------
617 ; Definitions of locally connected SIP devices
618 ;
619 ; type = user   a device that authenticates to us by "from" field to place calls
620 ; type = peer   a device we place calls to or that calls us and we match by host
621 ; type = friend two configurations (peer+user) in one
622 ;
623 ; For device names, we recommend using only a-z, numerics (0-9) and underscore
624
625 ; For local phones, type=friend works most of the time
626 ;
627 ; If you have one-way audio, you probably have NAT problems. 
628 ; If Asterisk is on a public IP, and the phone is inside of a NAT device
629 ; you will need to configure nat option for those phones.
630 ; Also, turn on qualify=yes to keep the nat session open
631 ;
632 ; Because you might have a large number of similar sections, it is generally
633 ; convenient to use templates for the common parameters, and add them
634 ; the the various sections. Examples are below, and we can even leave
635 ; the templates uncommented as they will not harm:
636
637 [basic-options](!)              ; a template
638         dtmfmode=rfc2833
639         context=from-office
640         type=friend
641
642 [natted-phone](!,basic-options) ; another template inheriting basic-options
643         nat=yes
644         canreinvite=no
645         host=dynamic
646
647 [public-phone](!,basic-options) ; another template inheriting basic-options
648         nat=no
649         canreinvite=yes
650
651 [my-codecs](!)          ; a template for my preferred codecs
652         disallow=all
653         allow=ilbc
654         allow=g729
655         allow=gsm
656         allow=g723
657         allow=ulaw
658
659 [ulaw-phone](!)         ; and another one for ulaw-only
660         disallow=all
661         allow=ulaw
662
663 ; and finally instantiate a few phones
664 ;
665 ; [2133](natted-phone,my-codecs)
666 ;       secret = peekaboo
667 ; [2134](natted-phone,ulaw-phone)
668 ;       secret = not_very_secret
669 ; [2136](public-phone,ulaw-phone)
670 ;       secret = not_very_secret_either
671 ; ...
672 ;
673
674 ; Standard configurations not using templates look like this:
675 ;
676 ;[grandstream1]
677 ;type=friend                    
678 ;context=from-sip               ; Where to start in the dialplan when this phone calls
679 ;callerid=John Doe <1234>       ; Full caller ID, to override the phones config
680                                 ; on incoming calls to Asterisk
681 ;host=192.168.0.23              ; we have a static but private IP address
682                                 ; No registration allowed
683 ;nat=no                         ; there is not NAT between phone and Asterisk
684 ;canreinvite=yes                ; allow RTP voice traffic to bypass Asterisk
685 ;dtmfmode=info                  ; either RFC2833 or INFO for the BudgeTone
686 ;call-limit=1                   ; permit only 1 outgoing call and 1 incoming call at a time
687                                 ; from the phone to asterisk
688                                 ; 1 for the explicit peer, 1 for the explicit user,
689                                 ; remember that a friend equals 1 peer and 1 user in
690                                 ; memory
691                                 ; This will affect your subscriptions as well.
692                                 ; There is no combined call counter for a "friend"
693                                 ; so there's currently no way in sip.conf to limit
694                                 ; to one inbound or outbound call per phone. Use
695                                 ; the group counters in the dial plan for that.
696                                 ;
697 ;mailbox=1234@default           ; mailbox 1234 in voicemail context "default"
698 ;disallow=all                   ; need to disallow=all before we can use allow=
699 ;allow=ulaw                     ; Note: In user sections the order of codecs
700                                 ; listed with allow= does NOT matter!
701 ;allow=alaw
702 ;allow=g723.1                   ; Asterisk only supports g723.1 pass-thru!
703 ;allow=g729                     ; Pass-thru only unless g729 license obtained
704 ;callingpres=allowed_passed_screen      ; Set caller ID presentation
705                                 ; See README.callingpres for more information
706
707 ;[xlite1]
708 ; Turn off silence suppression in X-Lite ("Transmit Silence"=YES)!
709 ; Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
710 ;type=friend
711 ;regexten=1234                  ; When they register, create extension 1234
712 ;callerid="Jane Smith" <5678>
713 ;host=dynamic                   ; This device needs to register
714 ;nat=yes                        ; X-Lite is behind a NAT router
715 ;canreinvite=no                 ; Typically set to NO if behind NAT
716 ;disallow=all
717 ;allow=gsm                      ; GSM consumes far less bandwidth than ulaw
718 ;allow=ulaw
719 ;allow=alaw
720 ;mailbox=1234@default,1233@default      ; Subscribe to status of multiple mailboxes
721 ;registertrying=yes             ; Send a 100 Trying when the device registers.
722
723 ;[snom]
724 ;type=friend                    ; Friends place calls and receive calls
725 ;context=from-sip               ; Context for incoming calls from this user
726 ;secret=blah
727 ;subscribecontext=localextensions       ; Only allow SUBSCRIBE for local extensions
728 ;language=de                    ; Use German prompts for this user 
729 ;host=dynamic                   ; This peer register with us
730 ;dtmfmode=inband                ; Choices are inband, rfc2833, or info
731 ;defaultip=192.168.0.59         ; IP used until peer registers
732 ;mailbox=1234@context,2345      ; Mailbox(-es) for message waiting indicator
733 ;subscribemwi=yes               ; Only send notifications if this phone 
734                                 ; subscribes for mailbox notification
735 ;vmexten=voicemail              ; dialplan extension to reach mailbox 
736                                 ; sets the Message-Account in the MWI notify message
737                                 ; defaults to global vmexten which defaults to "asterisk"
738 ;disallow=all
739 ;allow=ulaw                     ; dtmfmode=inband only works with ulaw or alaw!
740
741
742 ;[polycom]
743 ;type=friend                    ; Friends place calls and receive calls
744 ;context=from-sip               ; Context for incoming calls from this user
745 ;secret=blahpoly
746 ;host=dynamic                   ; This peer register with us
747 ;dtmfmode=rfc2833               ; Choices are inband, rfc2833, or info
748 ;username=polly                 ; Username to use in INVITE until peer registers
749                                 ; Normally you do NOT need to set this parameter
750 ;disallow=all
751 ;allow=ulaw                     ; dtmfmode=inband only works with ulaw or alaw!
752 ;progressinband=no              ; Polycom phones don't work properly with "never"
753
754
755 ;[pingtel]
756 ;type=friend
757 ;secret=blah
758 ;host=dynamic
759 ;insecure=port                  ; Allow matching of peer by IP address without 
760                                 ; matching port number
761 ;insecure=invite                ; Do not require authentication of incoming INVITEs
762 ;insecure=port,invite           ; (both)
763 ;qualify=1000                   ; Consider it down if it's 1 second to reply
764                                 ; Helps with NAT session
765                                 ; qualify=yes uses default value
766 ;
767 ; Call group and Pickup group should be in the range from 0 to 63
768 ;
769 ;callgroup=1,3-4                ; We are in caller groups 1,3,4
770 ;pickupgroup=1,3-5              ; We can do call pick-p for call group 1,3,4,5
771 ;defaultip=192.168.0.60         ; IP address to use if peer has not registered
772 ;deny=0.0.0.0/0.0.0.0           ; ACL: Control access to this account based on IP address
773 ;permit=192.168.0.60/255.255.255.0
774
775 ;[cisco1]
776 ;type=friend
777 ;secret=blah
778 ;qualify=200                    ; Qualify peer is no more than 200ms away
779 ;nat=yes                        ; This phone may be natted
780                                 ; Send SIP and RTP to the IP address that packet is 
781                                 ; received from instead of trusting SIP headers 
782 ;host=dynamic                   ; This device registers with us
783 ;canreinvite=no                 ; Asterisk by default tries to redirect the
784                                 ; RTP media stream (audio) to go directly from
785                                 ; the caller to the callee.  Some devices do not
786                                 ; support this (especially if one of them is 
787                                 ; behind a NAT).
788 ;defaultip=192.168.0.4          ; IP address to use until registration
789 ;username=goran                 ; Username to use when calling this device before registration
790                                 ; Normally you do NOT need to set this parameter
791 ;setvar=CUSTID=5678             ; Channel variable to be set for all calls from this device
792
793 ;[pre14-asterisk]
794 ;type=friend
795 ;secret=digium
796 ;host=dynamic
797 ;rfc2833compensate=yes          ; Compensate for pre-1.4 DTMF transmission from another Asterisk machine.
798                                 ; You must have this turned on or DTMF reception will work improperly.