2 ; SIP Configuration example for Asterisk
5 ;-----------------------------------------------------------
6 ; In the dialplan (extensions.conf) you can use several
7 ; syntaxes for dialing SIP devices.
9 ; SIP/username@domain (SIP uri)
10 ; SIP/username[:password[:md5secret[:authname[:transport]]]]@host[:port]
11 ; SIP/devicename/extension
15 ; devicename is defined as a peer in a section below.
18 ; Call any SIP user on the Internet
19 ; (Don't forget to enable DNS SRV records if you want to use this)
21 ; devicename/extension
22 ; If you define a SIP proxy as a peer below, you may call
23 ; SIP/proxyhostname/user or SIP/user@proxyhostname
24 ; where the proxyhostname is defined in a section below
25 ; This syntax also works with ATA's with FXO ports
27 ; SIP/username[:password[:md5secret[:authname]]]@host[:port]
28 ; This form allows you to specify password or md5secret and authname
29 ; without altering any authentication data in config.
33 ; SIP/sales:topsecret::account02@domain.com:5062
34 ; SIP/12345678::bc53f0ba8ceb1ded2b70e05c3f91de4f:myname@192.168.0.1
36 ; All of these dial strings specify the SIP request URI.
37 ; In addition, you can specify a specific To: header by adding an
38 ; exclamation mark after the dial string, like
40 ; SIP/sales@mysipproxy!sales@edvina.net
43 ; -------------------------------------------------------------
44 ; Useful CLI commands to check peers/users:
45 ; sip show peers Show all SIP peers (including friends)
46 ; sip show users Show all SIP users (including friends)
47 ; sip show registry Show status of hosts we register with
49 ; sip set debug Show all SIP messages
51 ; module reload chan_sip.so Reload configuration file
52 ; Active SIP peers will not be reconfigured
55 ; ** Deprecated configuration options **
56 ; The "call-limit" configuation option is deprecated. It still works in
57 ; this version of Asterisk, but will disappear in the next version.
58 ; You are encouraged to use the dialplan groupcount functionality
59 ; to enforce call limits instead of using this channel-specific method.
61 ; You can still set limits per device in sip.conf or in a database by using
62 ; "setvar" to set variables that can be used in the dialplan for various limits.
65 context=default ; Default context for incoming calls
66 ;allowguest=no ; Allow or reject guest calls (default is yes)
67 ;match_auth_username=yes ; if available, match user entry using the
68 ; 'username' field from the authentication line
69 ; instead of the From: field.
70 allowoverlap=no ; Disable overlap dialing support. (Default is yes)
71 ;allowtransfer=no ; Disable all transfers (unless enabled in peers or users)
73 ;realm=mydomain.tld ; Realm for digest authentication
74 ; defaults to "asterisk". If you set a system name in
75 ; asterisk.conf, it defaults to that system name
76 ; Realms MUST be globally unique according to RFC 3261
77 ; Set this to your host name or domain name
78 udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
79 ; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)
82 ; Note that the TCP and TLS support for chan_sip is currently considered
83 ; experimental. Since it is new, all of the related configuration options are
84 ; subject to change in any release. If they are changed, the changes will
85 ; be reflected in this sample configuration file, as well as in the UPGRADE.txt file.
87 tcpenable=no ; Enable server for incoming TCP connections (default is no)
88 tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
89 ; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)
91 ;tlsenable=no ; Enable server for incoming TLS (secure) connections (default is no)
92 ;tlsbindaddr=0.0.0.0 ; IP address for TLS server to bind to (0.0.0.0) binds to all interfaces)
93 ; Optionally add a port number, 192.168.1.1:5063 (default is port 5061)
94 ; Remember that the IP address must match the common name (hostname) in the
95 ; certificate, so you don't want to bind a TLS socket to multiple IP addresses.
97 ;tlscertfile=asterisk.pem ; Certificate file (*.pem only) to use for TLS connections
98 ; default is to look for "asterisk.pem" in current directory
100 ;tlscafile=</path/to/certificate>
101 ; If the server your connecting to uses a self signed certificate
102 ; you should have their certificate installed here so the code can
103 ; verify the authenticity of their certificate.
105 ;tlscadir=</path/to/ca/dir>
106 ; A directory full of CA certificates. The files must be named with
107 ; the CA subject name hash value.
108 ; (see man SSL_CTX_load_verify_locations for more info)
110 ;tlsdontverifyserver=[yes|no]
111 ; If set to yes, don't verify the servers certificate when acting as
112 ; a client. If you don't have the server's CA certificate you can
113 ; set this and it will connect without requiring tlscafile to be set.
116 ;tlscipher=<SSL cipher string>
117 ; A string specifying which SSL ciphers to use or not use
118 ; A list of valid SSL cipher strings can be found at:
119 ; http://www.openssl.org/docs/apps/ciphers.html#CIPHER_STRINGS
121 srvlookup=yes ; Enable DNS SRV lookups on outbound calls
122 ; Note: Asterisk only uses the first host
124 ; Disabling DNS SRV lookups disables the
125 ; ability to place SIP calls based on domain
126 ; names to some other SIP users on the Internet
128 ;pedantic=yes ; Enable checking of tags in headers,
129 ; international character conversions in URIs
130 ; and multiline formatted headers for strict
131 ; SIP compatibility (defaults to "no")
133 ; See qos.tex or Quality of Service section of asterisk.pdf for a description of these parameters.
134 ;tos_sip=cs3 ; Sets TOS for SIP packets.
135 ;tos_audio=ef ; Sets TOS for RTP audio packets.
136 ;tos_video=af41 ; Sets TOS for RTP video packets.
137 ;tos_text=af41 ; Sets TOS for RTP text packets.
139 ;cos_sip=3 ; Sets 802.1p priority for SIP packets.
140 ;cos_audio=5 ; Sets 802.1p priority for RTP audio packets.
141 ;cos_video=4 ; Sets 802.1p priority for RTP video packets.
142 ;cos_text=3 ; Sets 802.1p priority for RTP text packets.
144 ;maxexpiry=3600 ; Maximum allowed time of incoming registrations
145 ; and subscriptions (seconds)
146 ;minexpiry=60 ; Minimum length of registrations/subscriptions (default 60)
147 ;defaultexpiry=120 ; Default length of incoming/outgoing registration
148 ;qualifyfreq=60 ; Qualification: How often to check for the
149 ; host to be up in seconds
150 ; Set to low value if you use low timeout for
151 ; NAT of UDP sessions
152 ;notifymimetype=text/plain ; Allow overriding of mime type in MWI NOTIFY
153 ;buggymwi=no ; Cisco SIP firmware doesn't support the MWI RFC
154 ; fully. Enable this option to not get error messages
155 ; when sending MWI to phones with this bug.
156 ;vmexten=voicemail ; dialplan extension to reach mailbox sets the
157 ; Message-Account in the MWI notify message
158 ; defaults to "asterisk"
159 ;disallow=all ; First disallow all codecs
160 ;allow=ulaw ; Allow codecs in order of preference
161 ;allow=ilbc ; see doc/rtp-packetization for framing options
163 ; This option specifies a preference for which music on hold class this channel
164 ; should listen to when put on hold if the music class has not been set on the
165 ; channel with Set(CHANNEL(musicclass)=whatever) in the dialplan, and the peer
166 ; channel putting this one on hold did not suggest a music class.
168 ; This option may be specified globally, or on a per-user or per-peer basis.
170 ;mohinterpret=default
172 ; This option specifies which music on hold class to suggest to the peer channel
173 ; when this channel places the peer on hold. It may be specified globally or on
174 ; a per-user or per-peer basis.
178 ;parkinglot=plaza ; Sets the default parking lot for call parking
179 ; This may also be set for individual users/peers
180 ; Parkinglots are configured in features.conf
181 ;language=en ; Default language setting for all users/peers
182 ; This may also be set for individual users/peers
183 ;relaxdtmf=yes ; Relax dtmf handling
184 ;trustrpid = no ; If Remote-Party-ID should be trusted
185 ;sendrpid = yes ; If Remote-Party-ID should be sent
186 ;progressinband=never ; If we should generate in-band ringing always
187 ; use 'never' to never use in-band signalling, even in cases
188 ; where some buggy devices might not render it
189 ; Valid values: yes, no, never Default: never
190 ;useragent=Asterisk PBX ; Allows you to change the user agent string
191 ; The default user agent string also contains the Asterisk
192 ; version. If you don't want to expose this, change the
194 ;sdpsession=Asterisk PBX ; Allows you to change the SDP session name string, (s=)
195 ; Like the useragent parameter, the default user agent string
196 ; also contains the Asterisk version.
197 ;sdpowner=root ; Allows you to change the username field in the SDP owner string, (o=)
198 ; This field MUST NOT contain spaces
199 ;promiscredir = no ; If yes, allows 302 or REDIR to non-local SIP address
200 ; Note that promiscredir when redirects are made to the
201 ; local system will cause loops since Asterisk is incapable
202 ; of performing a "hairpin" call.
203 ;usereqphone = no ; If yes, ";user=phone" is added to uri that contains
204 ; a valid phone number
205 ;dtmfmode = rfc2833 ; Set default dtmfmode for sending DTMF. Default: rfc2833
207 ; info : SIP INFO messages (application/dtmf-relay)
208 ; shortinfo : SIP INFO messages (application/dtmf)
209 ; inband : Inband audio (requires 64 kbit codec -alaw, ulaw)
210 ; auto : Use rfc2833 if offered, inband otherwise
212 ;compactheaders = yes ; send compact sip headers.
214 ;videosupport=yes ; Turn on support for SIP video. You need to turn this
215 ; on in this section to get any video support at all.
216 ; You can turn it off on a per peer basis if the general
217 ; video support is enabled, but you can't enable it for
218 ; one peer only without enabling in the general section.
219 ; If you set videosupport to "always", then RTP ports will
220 ; always be set up for video, even on clients that don't
221 ; support it. This assists callfile-derived calls and
222 ; certain transferred calls to use always use video when
223 ; available. [yes|NO|always]
225 ;maxcallbitrate=384 ; Maximum bitrate for video calls (default 384 kb/s)
226 ; Videosupport and maxcallbitrate is settable
227 ; for peers and users as well
228 ;callevents=no ; generate manager events when sip ua
229 ; performs events (e.g. hold)
230 ;authfailureevents=no ; generate manager "peerstatus" events when peer can't
231 ; authenticate with Asterisk. Peerstatus will be "rejected".
232 ;alwaysauthreject = yes ; When an incoming INVITE or REGISTER is to be rejected,
233 ; for any reason, always reject with '401 Unauthorized'
234 ; instead of letting the requester know whether there was
235 ; a matching user or peer for their request
237 ;g726nonstandard = yes ; If the peer negotiates G726-32 audio, use AAL2 packing
238 ; order instead of RFC3551 packing order (this is required
239 ; for Sipura and Grandstream ATAs, among others). This is
240 ; contrary to the RFC3551 specification, the peer _should_
241 ; be negotiating AAL2-G726-32 instead :-(
242 ;outboundproxy=proxy.provider.domain ; send outbound signaling to this proxy, not directly to the devices
243 ;outboundproxy=proxy.provider.domain:8080 ; send outbound signaling to this proxy, not directly to the devices
244 ;outboundproxy=proxy.provider.domain,force ; Send ALL outbound signalling to proxy, ignoring route: headers
245 ;outboundproxy=tls://proxy.provider.domain ; same as '=proxy.provider.domain' except we try to connect with tls
246 ; ; (could also be tcp,udp) - defining transports on the proxy line only
247 ; ; applies for the global proxy, otherwise use the transport= option
248 ;matchexterniplocally = yes ; Only substitute the externip or externhost setting if it matches
249 ; your localnet setting. Unless you have some sort of strange network
250 ; setup you will not need to enable this.
252 ;dynamic_exclude_static = yes ; Disallow all dynamic hosts from registering
253 ; as any IP address used for staticly defined
254 ; hosts. This helps avoid the configuration
255 ; error of allowing your users to register at
256 ; the same address as a SIP provider.
258 ;contactdeny=0.0.0.0/0.0.0.0 ; Use contactpermit and contactdeny to
259 ;contactpermit=172.16.0.0/255.255.0.0 ; restrict at what IPs your users may
260 ; register their phones.
263 ; If regcontext is specified, Asterisk will dynamically create and destroy a
264 ; NoOp priority 1 extension for a given peer who registers or unregisters with
265 ; us and have a "regexten=" configuration item.
266 ; Multiple contexts may be specified by separating them with '&'. The
267 ; actual extension is the 'regexten' parameter of the registering peer or its
268 ; name if 'regexten' is not provided. If more than one context is provided,
269 ; the context must be specified within regexten by appending the desired
270 ; context after '@'. More than one regexten may be supplied if they are
271 ; separated by '&'. Patterns may be used in regexten.
273 ;regcontext=sipregistrations
274 ;regextenonqualify=yes ; Default "no"
275 ; If you have qualify on and the peer becomes unreachable
276 ; this setting will enforce inactivation of the regexten
277 ; extension for the peer
279 ;--------------------------- SIP timers ----------------------------------------------------
280 ; These timers are used primarily in INVITE transactions.
281 ; The default for Timer T1 is 500 ms or the measured run-trip time between
282 ; Asterisk and the device if you have qualify=yes for the device.
284 ;t1min=100 ; Minimum roundtrip time for messages to monitored hosts
286 ;timert1=500 ; Default T1 timer
287 ; Defaults to 500 ms or the measured round-trip
288 ; time to a peer (qualify=yes).
289 ;timerb=32000 ; Call setup timer. If a provisional response is not received
290 ; in this amount of time, the call will autocongest
291 ; Defaults to 64*timert1
293 ;--------------------------- RTP timers ----------------------------------------------------
294 ; These timers are currently used for both audio and video streams. The RTP timeouts
295 ; are only applied to the audio channel.
296 ; The settings are settable in the global section as well as per device
298 ;rtptimeout=60 ; Terminate call if 60 seconds of no RTP or RTCP activity
299 ; on the audio channel
300 ; when we're not on hold. This is to be able to hangup
301 ; a call in the case of a phone disappearing from the net,
302 ; like a powerloss or grandma tripping over a cable.
303 ;rtpholdtimeout=300 ; Terminate call if 300 seconds of no RTP or RTCP activity
304 ; on the audio channel
305 ; when we're on hold (must be > rtptimeout)
306 ;rtpkeepalive=<secs> ; Send keepalives in the RTP stream to keep NAT open
307 ; (default is off - zero)
309 ;--------------------------- SIP Session-Timers (RFC 4028)------------------------------------
310 ; SIP Session-Timers provide an end-to-end keep-alive mechanism for active SIP sessions.
311 ; This mechanism can detect and reclaim SIP channels that do not terminate through normal
312 ; signaling procedures. Session-Timers can be configured globally or at a user/peer level.
313 ; The operation of Session-Timers is driven by the following configuration parameters:
315 ; * session-timers - Session-Timers feature operates in the following three modes:
316 ; originate : Request and run session-timers always
317 ; accept : Run session-timers only when requested by other UA
318 ; refuse : Do not run session timers in any case
319 ; The default mode of operation is 'accept'.
320 ; * session-expires - Maximum session refresh interval in seconds. Defaults to 1800 secs.
321 ; * session-minse - Minimum session refresh interval in seconds. Defualts to 90 secs.
322 ; * session-refresher - The session refresher (uac|uas). Defaults to 'uas'.
324 ;session-timers=originate
327 ;session-refresher=uas
329 ;--------------------------- HASH TABLE SIZES ------------------------------------------------
330 ; For maximum efficiency, adjust the following
331 ; values to be slightly larger than the maximum number of in-memory objects (devices).
332 ; Too large, and space is wasted. Too small, and things will run slower.
333 ; 563 is probably way too big for small (home) applications, but it
334 ; should cover most small/medium sites.
335 ; It is recommended to make the sizes be a prime number!
336 ; This was internally set to 17 for small-memory applications...
337 ; All tables default to 563, except when compiled in LOW_MEMORY mode,
338 ; in which case, they default to 17. You can override this by uncommenting
339 ; the following, and changing the values.
344 ;--------------------------- SIP DEBUGGING ---------------------------------------------------
345 ;sipdebug = yes ; Turn on SIP debugging by default, from
346 ; the moment the channel loads this configuration
347 ;recordhistory=yes ; Record SIP history by default
348 ; (see sip history / sip no history)
349 ;dumphistory=yes ; Dump SIP history at end of SIP dialogue
350 ; SIP history is output to the DEBUG logging channel
353 ;--------------------------- STATUS NOTIFICATIONS (SUBSCRIPTIONS) ----------------------------
354 ; You can subscribe to the status of extensions with a "hint" priority
355 ; (See extensions.conf.sample for examples)
356 ; chan_sip support two major formats for notifications: dialog-info and SIMPLE
358 ; You will get more detailed reports (busy etc) if you have a call counter enabled
361 ; If you set the busylevel, we will indicate busy when we have a number of calls that
362 ; matches the busylevel treshold.
364 ; For queues, you will need this level of detail in status reporting, regardless
365 ; if you use SIP subscriptions. Queues and manager use the same internal interface
366 ; for reading status information.
368 ; Note: Subscriptions does not work if you have a realtime dialplan and use the
371 ;allowsubscribe=no ; Disable support for subscriptions. (Default is yes)
372 ;subscribecontext = default ; Set a specific context for SUBSCRIBE requests
373 ; Useful to limit subscriptions to local extensions
374 ; Settable per peer/user also
375 ;notifyringing = yes ; Control whether subscriptions already INUSE get sent
376 ; RINGING when another call is sent (default: no)
377 ;notifyhold = yes ; Notify subscriptions on HOLD state (default: no)
378 ; Turning on notifyringing and notifyhold will add a lot
379 ; more database transactions if you are using realtime.
380 ;callcounter = yes ; Enable call counters on devices. This can be set per
382 ;counteronpeer = yes ; Apply call counting on peers only. This will improve
383 ; status notification when you are using type=friend
384 ; Inbound calls, that really apply to the user part
385 ; of a friend will now be added to and compared with
386 ; the peer counter instead of applying two call counters,
387 ; one for the peer and one for the user.
388 ; "sip show inuse" will only show active calls on
389 ; the peer side of a "type=friend" object if this
390 ; setting is turned on.
392 ;----------------------------------------- T.38 FAX PASSTHROUGH SUPPORT -----------------------
394 ; This setting is available in the [general] section as well as in device configurations.
395 ; Setting this to yes, enables T.38 fax (UDPTL) passthrough on SIP to SIP calls, provided
396 ; both parties have T38 support enabled in their Asterisk configuration
397 ; This has to be enabled in the general section for all devices to work. You can then
398 ; disable it on a per device basis.
400 ; T.38 faxing only works in SIP to SIP calls, with no local or agent channel being used.
402 ; t38pt_udptl = yes ; Default false
404 ;----------------------------------------- OUTBOUND SIP REGISTRATIONS ------------------------
405 ; Asterisk can register as a SIP user agent to a SIP proxy (provider)
406 ; Format for the register statement is:
407 ; register => [transport://]user[:secret[:authuser]]@host[:port][/extension][~expiry]
411 ; If no extension is given, the 's' extension is used. The extension needs to
412 ; be defined in extensions.conf to be able to accept calls from this SIP proxy
415 ; host is either a host name defined in DNS or the name of a section defined
418 ; A similar effect can be achieved by adding a "callbackextension" option in a peer section.
419 ; this is equivalent to having the following line in the general section:
421 ; register => username:secret@host/callbackextension
423 ; and more readable because you don't have to write the parameters in two places
424 ; (note that the "port" is ignored - this is a bug that should be fixed).
428 ;register => 1234:password@mysipprovider.com
430 ; This will pass incoming calls to the 's' extension
433 ;register => 2345:password@sip_proxy/1234
435 ; Register 2345 at sip provider 'sip_proxy'. Calls from this provider
436 ; connect to local extension 1234 in extensions.conf, default context,
437 ; unless you configure a [sip_proxy] section below, and configure a
439 ; Tip 1: Avoid assigning hostname to a sip.conf section like [provider.com]
440 ; Tip 2: Use separate type=peer and type=user sections for SIP providers
441 ; (instead of type=friend) if you have calls in both directions
443 ;registertimeout=20 ; retry registration calls every 20 seconds (default)
444 ;registerattempts=10 ; Number of registration attempts before we give up
445 ; 0 = continue forever, hammering the other server
446 ; until it accepts the registration
447 ; Default is 0 tries, continue forever
449 ;----------------------------------------- NAT SUPPORT ------------------------
451 ; WARNING: SIP operation behind a NAT is tricky and you really need
452 ; to read and understand well the following section.
454 ; When Asterisk is behind a NAT device, the "local" address (and port) that
455 ; a socket is bound to has different values when seen from the inside or
456 ; from the outside of the NATted network. Unfortunately this address must
457 ; be communicated to the outside (e.g. in SIP and SDP messages), and in
458 ; order to determine the correct value Asterisk needs to know:
460 ; + whether it is talking to someone "inside" or "outside" of the NATted network.
461 ; This is configured by assigning the "localnet" parameter with a list
462 ; of network addresses that are considered "inside" of the NATted network.
463 ; IF LOCALNET IS NOT SET, THE EXTERNAL ADDRESS WILL NOT BE SET CORRECTLY.
464 ; Multiple entries are allowed, e.g. a reasonable set is the following:
466 ; localnet=192.168.0.0/255.255.0.0 ; RFC 1918 addresses
467 ; localnet=10.0.0.0/255.0.0.0 ; Also RFC1918
468 ; localnet=172.16.0.0/12 ; Another RFC1918 with CIDR notation
469 ; localnet=169.254.0.0/255.255.0.0 ; Zero conf local network
471 ; + the "externally visible" address and port number to be used when talking
472 ; to a host outside the NAT. This information is derived by one of the
473 ; following (mutually exclusive) config file parameters:
475 ; a. "externip = hostname[:port]" specifies a static address[:port] to
476 ; be used in SIP and SDP messages.
477 ; The hostname is looked up only once, when [re]loading sip.conf .
478 ; If a port number is not present, use the "bindport" value (which is
479 ; not guaranteed to work correctly, because a NAT box might remap the
480 ; port number as well as the address).
481 ; This approach can be useful if you have a NAT device where you can
482 ; configure the mapping statically. Examples:
484 ; externip = 12.34.56.78 ; use this address.
485 ; externip = 12.34.56.78:9900 ; use this address and port.
486 ; externip = mynat.my.org:12600 ; Public address of my nat box.
488 ; b. "externhost = hostname[:port]" is similar to "externip" except
489 ; that the hostname is looked up every "externrefresh" seconds
490 ; (default 10s). This can be useful when your NAT device lets you choose
491 ; the port mapping, but the IP address is dynamic.
492 ; Beware, you might suffer from service disruption when the name server
493 ; resolution fails. Examples:
495 ; externhost=foo.dyndns.net ; refreshed periodically
496 ; externrefresh=180 ; change the refresh interval
498 ; c. "stunaddr = stun.server[:port]" queries the STUN server specified
499 ; as an argument to obtain the external address/port.
500 ; Queries are also sent periodically every "externrefresh" seconds
501 ; (as a side effect, sending the query also acts as a keepalive for
502 ; the state entry on the nat box):
504 ; stunaddr = foo.stun.com:3478
507 ; Note that at the moment all these mechanism work only for the SIP socket.
508 ; The IP address discovered with externip/externhost/STUN is reused for
509 ; media sessions as well, but the port numbers are not remapped so you
510 ; may still experience problems.
512 ; NOTE 1: in some cases, NAT boxes will use different port numbers in
513 ; the internal<->external mapping. In these cases, the "externip" and
514 ; "externhost" might not help you configure addresses properly, and you
515 ; really need to use STUN.
517 ; NOTE 2: when using "externip" or "externhost", the address part is
518 ; also used as the external address for media sessions.
519 ; If you use "stunaddr", STUN queries will be sent to the same server
520 ; also from media sockets, and this should permit a correct mapping of
521 ; the port numbers as well.
523 ; In addition to the above, Asterisk has an additional "nat" parameter to
524 ; address NAT-related issues in incoming SIP or media sessions.
525 ; In particular, depending on the 'nat= ' settings described below, Asterisk
526 ; may override the address/port information specified in the SIP/SDP messages,
527 ; and use the information (sender address) supplied by the network stack instead.
528 ; However, this is only useful if the external traffic can reach us.
529 ; The following settings are allowed (both globally and in individual sections):
531 ; nat = no ; default. Use NAT mode only according to RFC3581 (;rport)
532 ; nat = yes ; Always ignore info and assume NAT
533 ; nat = never ; Never attempt NAT mode or RFC3581 support
534 ; nat = route ; route = Assume NAT, don't send rport
535 ; ; (work around more UNIDEN bugs)
537 ;----------------------------------- MEDIA HANDLING --------------------------------
538 ; By default, Asterisk tries to re-invite the audio to an optimal path. If there's
539 ; no reason for Asterisk to stay in the media path, the media will be redirected.
540 ; This does not really work with in the case where Asterisk is outside and have
541 ; clients on the inside of a NAT. In that case, you want to set canreinvite=nonat
543 ;canreinvite=yes ; Asterisk by default tries to redirect the
544 ; RTP media stream (audio) to go directly from
545 ; the caller to the callee. Some devices do not
546 ; support this (especially if one of them is behind a NAT).
547 ; The default setting is YES. If you have all clients
548 ; behind a NAT, or for some other reason wants Asterisk to
549 ; stay in the audio path, you may want to turn this off.
551 ; This setting also affect direct RTP
552 ; at call setup (a new feature in 1.4 - setting up the
553 ; call directly between the endpoints instead of sending
556 ;directrtpsetup=yes ; Enable the new experimental direct RTP setup. This sets up
557 ; the call directly with media peer-2-peer without re-invites.
558 ; Will not work for video and cases where the callee sends
559 ; RTP payloads and fmtp headers in the 200 OK that does not match the
560 ; callers INVITE. This will also fail if canreinvite is enabled when
561 ; the device is actually behind NAT.
563 ;canreinvite=nonat ; An additional option is to allow media path redirection
564 ; (reinvite) but only when the peer where the media is being
565 ; sent is known to not be behind a NAT (as the RTP core can
566 ; determine it based on the apparent IP address the media
569 ;canreinvite=update ; Yet a third option... use UPDATE for media path redirection,
570 ; instead of INVITE. This can be combined with 'nonat', as
571 ; 'canreinvite=update,nonat'. It implies 'yes'.
573 ;----------------------------------------- REALTIME SUPPORT ------------------------
574 ; For additional information on ARA, the Asterisk Realtime Architecture,
575 ; please read realtime.txt and extconfig.txt in the /doc directory of the
578 ;rtcachefriends=yes ; Cache realtime friends by adding them to the internal list
579 ; just like friends added from the config file only on a
580 ; as-needed basis? (yes|no)
582 ;rtsavesysname=yes ; Save systemname in realtime database at registration
585 ;rtupdate=yes ; Send registry updates to database using realtime? (yes|no)
586 ; If set to yes, when a SIP UA registers successfully, the ip address,
587 ; the origination port, the registration period, and the username of
588 ; the UA will be set to database via realtime.
589 ; If not present, defaults to 'yes'. Note: realtime peers will
590 ; probably not function across reloads in the way that you expect, if
591 ; you turn this option off.
592 ;rtautoclear=yes ; Auto-Expire friends created on the fly on the same schedule
593 ; as if it had just registered? (yes|no|<seconds>)
594 ; If set to yes, when the registration expires, the friend will
595 ; vanish from the configuration until requested again. If set
596 ; to an integer, friends expire within this number of seconds
597 ; instead of the registration interval.
599 ;ignoreregexpire=yes ; Enabling this setting has two functions:
601 ; For non-realtime peers, when their registration expires, the
602 ; information will _not_ be removed from memory or the Asterisk database
603 ; if you attempt to place a call to the peer, the existing information
604 ; will be used in spite of it having expired
606 ; For realtime peers, when the peer is retrieved from realtime storage,
607 ; the registration information will be used regardless of whether
608 ; it has expired or not; if it expires while the realtime peer
609 ; is still in memory (due to caching or other reasons), the
610 ; information will not be removed from realtime storage
612 ;----------------------------------------- SIP DOMAIN SUPPORT ------------------------
613 ; Incoming INVITE and REFER messages can be matched against a list of 'allowed'
614 ; domains, each of which can direct the call to a specific context if desired.
615 ; By default, all domains are accepted and sent to the default context or the
616 ; context associated with the user/peer placing the call.
617 ; REGISTER to non-local domains will be automatically denied if a domain
618 ; list is configured.
620 ; Domains can be specified using:
621 ; domain=<domain>[,<context>]
623 ; domain=myasterisk.dom
624 ; domain=customer.com,customer-context
626 ; In addition, all the 'default' domains associated with a server should be
627 ; added if incoming request filtering is desired.
630 ; To disallow requests for domains not serviced by this server:
631 ; allowexternaldomains=no
633 ;domain=mydomain.tld,mydomain-incoming
634 ; Add domain and configure incoming context
635 ; for external calls to this domain
636 ;domain=1.2.3.4 ; Add IP address as local domain
637 ; You can have several "domain" settings
638 ;allowexternaldomains=no ; Disable INVITE and REFER to non-local domains
640 ;autodomain=yes ; Turn this on to have Asterisk add local host
641 ; name and local IP to domain list.
643 ; fromdomain=mydomain.tld ; When making outbound SIP INVITEs to
644 ; non-peers, use your primary domain "identity"
645 ; for From: headers instead of just your IP
646 ; address. This is to be polite and
647 ; it may be a mandatory requirement for some
648 ; destinations which do not have a prior
649 ; account relationship with your server.
651 ;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
652 ; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a
653 ; SIP channel. Defaults to "no". An enabled jitterbuffer will
654 ; be used only if the sending side can create and the receiving
655 ; side can not accept jitter. The SIP channel can accept jitter,
656 ; thus a jitterbuffer on the receive SIP side will be used only
657 ; if it is forced and enabled.
659 ; jbforce = no ; Forces the use of a jitterbuffer on the receive side of a SIP
660 ; channel. Defaults to "no".
662 ; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds.
664 ; jbresyncthreshold = 1000 ; Jump in the frame timestamps over which the jitterbuffer is
665 ; resynchronized. Useful to improve the quality of the voice, with
666 ; big jumps in/broken timestamps, usually sent from exotic devices
667 ; and programs. Defaults to 1000.
669 ; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a SIP
670 ; channel. Two implementations are currently available - "fixed"
671 ; (with size always equals to jbmaxsize) and "adaptive" (with
672 ; variable size, actually the new jb of IAX2). Defaults to fixed.
674 ; jblog = no ; Enables jitterbuffer frame logging. Defaults to "no".
675 ;-----------------------------------------------------------------------------------
678 ; Global credentials for outbound calls, i.e. when a proxy challenges your
679 ; Asterisk server for authentication. These credentials override
680 ; any credentials in peer/register definition if realm is matched.
682 ; This way, Asterisk can authenticate for outbound calls to other
683 ; realms. We match realm on the proxy challenge and pick an set of
684 ; credentials from this list
686 ; auth = <user>:<secret>@<realm>
687 ; auth = <user>#<md5secret>@<realm>
689 ;auth=mark:topsecret@digium.com
691 ; You may also add auth= statements to [peer] definitions
692 ; Peer auth= override all other authentication settings if we match on realm
694 ;------------------------------------------------------------------------------
695 ; Users and peers have different settings available. Friends have all settings,
696 ; since a friend is both a peer and a user
698 ; User config options: Peer configuration:
699 ; -------------------- -------------------
701 ; callingpres callingpres
705 ; md5secret md5secret
706 ; transport transport
708 ; canreinvite canreinvite
710 ; callgroup callgroup
711 ; pickupgroup pickupgroup
716 ; trustrpid trustrpid
717 ; progressinband progressinband
718 ; promiscredir promiscredir
719 ; useclientcode useclientcode
720 ; accountcode accountcode
724 ; call-limit call-limit (deprecated)
725 ; callcounter callcounter
726 ; allowoverlap allowoverlap
727 ; allowsubscribe allowsubscribe
728 ; allowtransfer allowtransfer
729 ; subscribecontext subscribecontext
730 ; videosupport videosupport
731 ; maxcallbitrate maxcallbitrate
732 ; rfc2833compensate mailbox
733 ; session-timers busylevel
735 ; session-minse template
736 ; session-refresher fromdomain
737 ; t38pt_usertpsource regexten
759 ; contactpermit ; Limit what a host may register as (a neat trick
760 ; contactdeny ; is to register at the same IP as a SIP provider,
761 ; ; then call oneself, and get redirected to that
765 ; For incoming calls only. Example: FWD (Free World Dialup)
766 ; We match on IP address of the proxy for incoming calls
767 ; since we can not match on username (caller id)
773 ;type=peer ; we only want to call out, not be called
775 ;defaultuser=yourusername ; Authentication user for outbound proxies
776 ;fromuser=yourusername ; Many SIP providers require this!
777 ;fromdomain=provider.sip.domain
778 ;host=box.provider.com
779 ;transport=udp,tcp ; This sets the transport type to udp for outgoing, and will
780 ; ; accept both tcp and udp. Default is udp. The first transport
781 ; ; listed will always be used for outgoing connections.
782 ;usereqphone=yes ; This provider requires ";user=phone" on URI
783 ;callcounter=yes ; Enable call counter
784 ;busylevel=2 ; Signal busy at 2 or more calls
785 ;outboundproxy=proxy.provider.domain ; send outbound signaling to this proxy, not directly to the peer
786 ;port=80 ; The port number we want to connect to on the remote side
787 ; Also used as "defaultport" in combination with "defaultip" settings
789 ;--- sample definition for a provider
792 ;host=sip.provider1.com
793 ;fromuser=4015552299 ; how your provider knows you
794 ;secret=youwillneverguessit
795 ;callbackextension=123 ; Register with this server and require calls coming back to this extension
796 ;transport=udp,tcp ; This sets the transport type to udp for outgoing, and will
797 ; ; accept both tcp and udp. Default is udp. The first transport
798 ; ; listed will always be used for outgoing connections.
800 ;------------------------------------------------------------------------------
801 ; Definitions of locally connected SIP devices
803 ; type = user a device that authenticates to us by "from" field to place calls
804 ; type = peer a device we place calls to or that calls us and we match by host
805 ; type = friend two configurations (peer+user) in one
807 ; For device names, we recommend using only a-z, numerics (0-9) and underscore
809 ; For local phones, type=friend works most of the time
811 ; If you have one-way audio, you probably have NAT problems.
812 ; If Asterisk is on a public IP, and the phone is inside of a NAT device
813 ; you will need to configure nat option for those phones.
814 ; Also, turn on qualify=yes to keep the nat session open
816 ; Because you might have a large number of similar sections, it is generally
817 ; convenient to use templates for the common parameters, and add them
818 ; the the various sections. Examples are below, and we can even leave
819 ; the templates uncommented as they will not harm:
821 [basic-options](!) ; a template
826 [natted-phone](!,basic-options) ; another template inheriting basic-options
831 [public-phone](!,basic-options) ; another template inheriting basic-options
835 [my-codecs](!) ; a template for my preferred codecs
843 [ulaw-phone](!) ; and another one for ulaw-only
847 ; and finally instantiate a few phones
849 ; [2133](natted-phone,my-codecs)
851 ; [2134](natted-phone,ulaw-phone)
852 ; secret = not_very_secret
853 ; [2136](public-phone,ulaw-phone)
854 ; secret = not_very_secret_either
858 ; Standard configurations not using templates look like this:
862 ;context=from-sip ; Where to start in the dialplan when this phone calls
863 ;callerid=John Doe <1234> ; Full caller ID, to override the phones config
864 ; on incoming calls to Asterisk
865 ;host=192.168.0.23 ; we have a static but private IP address
866 ; No registration allowed
867 ;nat=no ; there is not NAT between phone and Asterisk
868 ;canreinvite=yes ; allow RTP voice traffic to bypass Asterisk
869 ;dtmfmode=info ; either RFC2833 or INFO for the BudgeTone
870 ;call-limit=1 ; permit only 1 outgoing call and 1 incoming call at a time
871 ; from the phone to asterisk (deprecated)
872 ; 1 for the explicit peer, 1 for the explicit user,
873 ; remember that a friend equals 1 peer and 1 user in
875 ; There is no combined call counter for a "friend"
876 ; so there's currently no way in sip.conf to limit
877 ; to one inbound or outbound call per phone. Use
878 ; the group counters in the dial plan for that.
880 ;mailbox=1234@default ; mailbox 1234 in voicemail context "default"
881 ;disallow=all ; need to disallow=all before we can use allow=
882 ;allow=ulaw ; Note: In user sections the order of codecs
883 ; listed with allow= does NOT matter!
885 ;allow=g723.1 ; Asterisk only supports g723.1 pass-thru!
886 ;allow=g729 ; Pass-thru only unless g729 license obtained
887 ;callingpres=allowed_passed_screen ; Set caller ID presentation
888 ; See README.callingpres for more information
891 ; Turn off silence suppression in X-Lite ("Transmit Silence"=YES)!
892 ; Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
894 ;regexten=1234 ; When they register, create extension 1234
895 ;callerid="Jane Smith" <5678>
896 ;host=dynamic ; This device needs to register
897 ;nat=yes ; X-Lite is behind a NAT router
898 ;canreinvite=no ; Typically set to NO if behind NAT
900 ;allow=gsm ; GSM consumes far less bandwidth than ulaw
903 ;mailbox=1234@default,1233@default ; Subscribe to status of multiple mailboxes
904 ;registertrying=yes ; Send a 100 Trying when the device registers.
907 ;type=friend ; Friends place calls and receive calls
908 ;context=from-sip ; Context for incoming calls from this user
910 ;subscribecontext=localextensions ; Only allow SUBSCRIBE for local extensions
911 ;language=de ; Use German prompts for this user
912 ;host=dynamic ; This peer register with us
913 ;dtmfmode=inband ; Choices are inband, rfc2833, or info
914 ;defaultip=192.168.0.59 ; IP used until peer registers
915 ;mailbox=1234@context,2345 ; Mailbox(-es) for message waiting indicator
916 ;subscribemwi=yes ; Only send notifications if this phone
917 ; subscribes for mailbox notification
918 ;vmexten=voicemail ; dialplan extension to reach mailbox
919 ; sets the Message-Account in the MWI notify message
920 ; defaults to global vmexten which defaults to "asterisk"
922 ;allow=ulaw ; dtmfmode=inband only works with ulaw or alaw!
926 ;type=friend ; Friends place calls and receive calls
927 ;context=from-sip ; Context for incoming calls from this user
929 ;host=dynamic ; This peer register with us
930 ;dtmfmode=rfc2833 ; Choices are inband, rfc2833, or info
931 ;defaultuser=polly ; Username to use in INVITE until peer registers
932 ;defaultip=192.168.40.123
933 ; Normally you do NOT need to set this parameter
935 ;allow=ulaw ; dtmfmode=inband only works with ulaw or alaw!
936 ;progressinband=no ; Polycom phones don't work properly with "never"
943 ;insecure=port ; Allow matching of peer by IP address without
944 ; matching port number
945 ;insecure=invite ; Do not require authentication of incoming INVITEs
946 ;insecure=port,invite ; (both)
947 ;qualify=1000 ; Consider it down if it's 1 second to reply
948 ; Helps with NAT session
949 ; qualify=yes uses default value
950 ;qualifyfreq=60 ; Qualification: How often to check for the
951 ; host to be up in seconds
952 ; Set to low value if you use low timeout for
953 ; NAT of UDP sessions
955 ; Call group and Pickup group should be in the range from 0 to 63
957 ;callgroup=1,3-4 ; We are in caller groups 1,3,4
958 ;pickupgroup=1,3-5 ; We can do call pick-p for call group 1,3,4,5
959 ;defaultip=192.168.0.60 ; IP address to use if peer has not registered
960 ;deny=0.0.0.0/0.0.0.0 ; ACL: Control access to this account based on IP address
961 ;permit=192.168.0.60/255.255.255.0
966 ;qualify=200 ; Qualify peer is no more than 200ms away
967 ;nat=yes ; This phone may be natted
968 ; Send SIP and RTP to the IP address that packet is
969 ; received from instead of trusting SIP headers
970 ;host=dynamic ; This device registers with us
971 ;canreinvite=no ; Asterisk by default tries to redirect the
972 ; RTP media stream (audio) to go directly from
973 ; the caller to the callee. Some devices do not
974 ; support this (especially if one of them is
976 ;defaultip=192.168.0.4 ; IP address to use until registration
977 ;defaultuser=goran ; Username to use when calling this device before registration
978 ; Normally you do NOT need to set this parameter
979 ;setvar=CUSTID=5678 ; Channel variable to be set for all calls from this device
980 ;setvar=ATTENDED_TRANSFER_COMPLETE_SOUND=beep ; This channel variable will
981 ; cause the given audio file to
982 ; be played upon completion of
983 ; an attended transfer.
989 ;rfc2833compensate=yes ; Compensate for pre-1.4 DTMF transmission from another Asterisk machine.
990 ; You must have this turned on or DTMF reception will work improperly.
991 ;t38pt_usertpsource=yes ; Use the source IP address of RTP as the destination IP address for UDPTL packets
992 ; if the nat option is enabled. If a single RTP packet is received Asterisk will know the
993 ; external IP address of the remote device. If port forwarding is done at the client side
994 ; then UDPTL will flow to the remote device.