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 registry Show status of hosts we register with
48 ; sip set debug on Show all SIP messages
50 ; module reload chan_sip.so Reload configuration file
52 ;------- Naming devices ------------------------------------------------------
54 ; When naming devices, make sure you understand how Asterisk matches calls
56 ; 1. Asterisk checks the SIP From: address username and matches against
57 ; names of devices with type=user
58 ; The name is the text between square brackets [name]
59 ; 2. Asterisk checks the From: addres and matches the list of devices
61 ; 3. Asterisk checks the IP address (and port number) that the INVITE
62 ; was sent from and matches against any devices with type=peer
64 ; Don't mix extensions with the names of the devices. Devices need a unique
65 ; name. The device name is *not* used as phone numbers. Phone numbers are
66 ; anything you declare as an extension in the dialplan (extensions.conf).
68 ; When setting up trunks, make sure there's no risk that any From: username
69 ; (caller ID) will match any of your device names, because then Asterisk
70 ; might match the wrong device.
72 ; Note: The parameter "username" is not the username and in most cases is
73 ; not needed at all. Check below. In later releases, it's renamed
74 ; to "defaultuser" which is a better name, since it is used in
75 ; combination with the "defaultip" setting.
76 ;-----------------------------------------------------------------------------
78 ; ** Deprecated configuration options **
79 ; The "call-limit" configuation option is deprecated. It still works in
80 ; this version of Asterisk, but will disappear in the next version.
81 ; You are encouraged to use the dialplan groupcount functionality
82 ; to enforce call limits instead of using this channel-specific method.
84 ; You can still set limits per device in sip.conf or in a database by using
85 ; "setvar" to set variables that can be used in the dialplan for various limits.
88 context=default ; Default context for incoming calls
89 ;allowguest=no ; Allow or reject guest calls (default is yes)
90 ;match_auth_username=yes ; if available, match user entry using the
91 ; 'username' field from the authentication line
92 ; instead of the From: field.
93 allowoverlap=no ; Disable overlap dialing support. (Default is yes)
94 ;allowtransfer=no ; Disable all transfers (unless enabled in peers or users)
96 ;realm=mydomain.tld ; Realm for digest authentication
97 ; defaults to "asterisk". If you set a system name in
98 ; asterisk.conf, it defaults to that system name
99 ; Realms MUST be globally unique according to RFC 3261
100 ; Set this to your host name or domain name
101 udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
102 ; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)
105 ; Note that the TCP and TLS support for chan_sip is currently considered
106 ; experimental. Since it is new, all of the related configuration options are
107 ; subject to change in any release. If they are changed, the changes will
108 ; be reflected in this sample configuration file, as well as in the UPGRADE.txt file.
110 tcpenable=no ; Enable server for incoming TCP connections (default is no)
111 tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
112 ; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)
114 ;tlsenable=no ; Enable server for incoming TLS (secure) connections (default is no)
115 ;tlsbindaddr=0.0.0.0 ; IP address for TLS server to bind to (0.0.0.0) binds to all interfaces)
116 ; Optionally add a port number, 192.168.1.1:5063 (default is port 5061)
117 ; Remember that the IP address must match the common name (hostname) in the
118 ; certificate, so you don't want to bind a TLS socket to multiple IP addresses.
120 ;tlscertfile=</path/to/certificate.pem> ; Certificate file (*.pem only) to use for TLS connections
121 ; default is to look for "asterisk.pem" in current directory
123 ;tlsprivatekey=</path/to/private.pem> ; Private key file (*.pem only) for TLS connections.
124 ; If no tlsprivatekey is specified, tlscertfile is searched for
125 ; for both public and private key.
127 ;tlscafile=</path/to/certificate>
128 ; If the server your connecting to uses a self signed certificate
129 ; you should have their certificate installed here so the code can
130 ; verify the authenticity of their certificate.
132 ;tlscadir=</path/to/ca/dir>
133 ; A directory full of CA certificates. The files must be named with
134 ; the CA subject name hash value.
135 ; (see man SSL_CTX_load_verify_locations for more info)
137 ;tlsdontverifyserver=[yes|no]
138 ; If set to yes, don't verify the servers certificate when acting as
139 ; a client. If you don't have the server's CA certificate you can
140 ; set this and it will connect without requiring tlscafile to be set.
143 ;tlscipher=<SSL cipher string>
144 ; A string specifying which SSL ciphers to use or not use
145 ; A list of valid SSL cipher strings can be found at:
146 ; http://www.openssl.org/docs/apps/ciphers.html#CIPHER_STRINGS
148 ;tlsclientmethod=tlsv1 ; values include tlsv1, sslv3, sslv2.
149 ; Specify protocol for outbound client connections.
150 ; If left unspecified, the default is sslv2.
152 srvlookup=yes ; Enable DNS SRV lookups on outbound calls
153 ; Note: Asterisk only uses the first host
155 ; Disabling DNS SRV lookups disables the
156 ; ability to place SIP calls based on domain
157 ; names to some other SIP users on the Internet
159 ;pedantic=yes ; Enable checking of tags in headers,
160 ; international character conversions in URIs
161 ; and multiline formatted headers for strict
162 ; SIP compatibility (defaults to "no")
164 ; See qos.tex or Quality of Service section of asterisk.pdf for a description of these parameters.
165 ;tos_sip=cs3 ; Sets TOS for SIP packets.
166 ;tos_audio=ef ; Sets TOS for RTP audio packets.
167 ;tos_video=af41 ; Sets TOS for RTP video packets.
168 ;tos_text=af41 ; Sets TOS for RTP text packets.
170 ;cos_sip=3 ; Sets 802.1p priority for SIP packets.
171 ;cos_audio=5 ; Sets 802.1p priority for RTP audio packets.
172 ;cos_video=4 ; Sets 802.1p priority for RTP video packets.
173 ;cos_text=3 ; Sets 802.1p priority for RTP text packets.
175 ;maxexpiry=3600 ; Maximum allowed time of incoming registrations
176 ; and subscriptions (seconds)
177 ;minexpiry=60 ; Minimum length of registrations/subscriptions (default 60)
178 ;defaultexpiry=120 ; Default length of incoming/outgoing registration
179 ;mwiexpiry=3600 ; Expiry time for outgoing MWI subscriptions
180 ;qualifyfreq=60 ; Qualification: How often to check for the
181 ; host to be up in seconds
182 ; Set to low value if you use low timeout for
183 ; NAT of UDP sessions
184 ;qualifygap=100 ; Number of milliseconds between each group of peers being qualified
185 ;qualifypeers=1 ; Number of peers in a group to be qualified at the same time
186 ;notifymimetype=text/plain ; Allow overriding of mime type in MWI NOTIFY
187 ;buggymwi=no ; Cisco SIP firmware doesn't support the MWI RFC
188 ; fully. Enable this option to not get error messages
189 ; when sending MWI to phones with this bug.
190 ;mwi_from=asterisk ; When sending MWI NOTIFY requests, use this setting in
191 ; the From: header as the "name" portion. Also fill the
192 ; "user" portion of the URI in the From: header with this
193 ; value if no fromuser is set
195 ;vmexten=voicemail ; dialplan extension to reach mailbox sets the
196 ; Message-Account in the MWI notify message
197 ; defaults to "asterisk"
199 ;preferred_codec_only=yes ; Respond to a SIP invite with the single most preferred codec
200 ; rather than advertising all joint codec capabilities. This
201 ; limits the other side's codec choice to exactly what we prefer.
203 ;disallow=all ; First disallow all codecs
204 ;allow=ulaw ; Allow codecs in order of preference
205 ;allow=ilbc ; see doc/rtp-packetization for framing options
207 ; This option specifies a preference for which music on hold class this channel
208 ; should listen to when put on hold if the music class has not been set on the
209 ; channel with Set(CHANNEL(musicclass)=whatever) in the dialplan, and the peer
210 ; channel putting this one on hold did not suggest a music class.
212 ; This option may be specified globally, or on a per-user or per-peer basis.
214 ;mohinterpret=default
216 ; This option specifies which music on hold class to suggest to the peer channel
217 ; when this channel places the peer on hold. It may be specified globally or on
218 ; a per-user or per-peer basis.
222 ;parkinglot=plaza ; Sets the default parking lot for call parking
223 ; This may also be set for individual users/peers
224 ; Parkinglots are configured in features.conf
225 ;language=en ; Default language setting for all users/peers
226 ; This may also be set for individual users/peers
227 ;relaxdtmf=yes ; Relax dtmf handling
228 ;trustrpid = no ; If Remote-Party-ID should be trusted
229 ;sendrpid = yes ; If Remote-Party-ID should be sent
230 ;sendrpid = rpid ; Use the "Remote-Party-ID" header
231 ; to send the identity of the remote party
232 ; This is identical to sendrpid=yes
233 ;sendrpid = pai ; Use the "P-Asserted-Identity" header
234 ; to send the identity of the remote party
235 ;rpid_update = no ; In certain cases, the only method by which a connected line
236 ; change may be immediately transmitted is with a SIP UPDATE request.
237 ; If communicating with another Asterisk server, and you wish to be able
238 ; transmit such UPDATE messages to it, then you must enable this option.
239 ; Otherwise, we will have to wait until we can send a reinvite to
240 ; transmit the information.
242 ;progressinband=never ; If we should generate in-band ringing always
243 ; use 'never' to never use in-band signalling, even in cases
244 ; where some buggy devices might not render it
245 ; Valid values: yes, no, never Default: never
246 ;useragent=Asterisk PBX ; Allows you to change the user agent string
247 ; The default user agent string also contains the Asterisk
248 ; version. If you don't want to expose this, change the
250 ;sdpsession=Asterisk PBX ; Allows you to change the SDP session name string, (s=)
251 ; Like the useragent parameter, the default user agent string
252 ; also contains the Asterisk version.
253 ;sdpowner=root ; Allows you to change the username field in the SDP owner string, (o=)
254 ; This field MUST NOT contain spaces
255 ;promiscredir = no ; If yes, allows 302 or REDIR to non-local SIP address
256 ; Note that promiscredir when redirects are made to the
257 ; local system will cause loops since Asterisk is incapable
258 ; of performing a "hairpin" call.
259 ;usereqphone = no ; If yes, ";user=phone" is added to uri that contains
260 ; a valid phone number
261 ;dtmfmode = rfc2833 ; Set default dtmfmode for sending DTMF. Default: rfc2833
263 ; info : SIP INFO messages (application/dtmf-relay)
264 ; shortinfo : SIP INFO messages (application/dtmf)
265 ; inband : Inband audio (requires 64 kbit codec -alaw, ulaw)
266 ; auto : Use rfc2833 if offered, inband otherwise
268 ;compactheaders = yes ; send compact sip headers.
270 ;videosupport=yes ; Turn on support for SIP video. You need to turn this
271 ; on in this section to get any video support at all.
272 ; You can turn it off on a per peer basis if the general
273 ; video support is enabled, but you can't enable it for
274 ; one peer only without enabling in the general section.
275 ; If you set videosupport to "always", then RTP ports will
276 ; always be set up for video, even on clients that don't
277 ; support it. This assists callfile-derived calls and
278 ; certain transferred calls to use always use video when
279 ; available. [yes|NO|always]
281 ;maxcallbitrate=384 ; Maximum bitrate for video calls (default 384 kb/s)
282 ; Videosupport and maxcallbitrate is settable
283 ; for peers and users as well
284 ;callevents=no ; generate manager events when sip ua
285 ; performs events (e.g. hold)
286 ;authfailureevents=no ; generate manager "peerstatus" events when peer can't
287 ; authenticate with Asterisk. Peerstatus will be "rejected".
288 ;alwaysauthreject = yes ; When an incoming INVITE or REGISTER is to be rejected,
289 ; for any reason, always reject with an identical response
290 ; equivalent to valid username and invalid password/hash
291 ; instead of letting the requester know whether there was
292 ; a matching user or peer for their request. This reduces
293 ; the ability of an attacker to scan for valid SIP usernames.
295 ;g726nonstandard = yes ; If the peer negotiates G726-32 audio, use AAL2 packing
296 ; order instead of RFC3551 packing order (this is required
297 ; for Sipura and Grandstream ATAs, among others). This is
298 ; contrary to the RFC3551 specification, the peer _should_
299 ; be negotiating AAL2-G726-32 instead :-(
300 ;outboundproxy=proxy.provider.domain ; send outbound signaling to this proxy, not directly to the devices
301 ;outboundproxy=proxy.provider.domain:8080 ; send outbound signaling to this proxy, not directly to the devices
302 ;outboundproxy=proxy.provider.domain,force ; Send ALL outbound signalling to proxy, ignoring route: headers
303 ;outboundproxy=tls://proxy.provider.domain ; same as '=proxy.provider.domain' except we try to connect with tls
304 ; ; (could also be tcp,udp) - defining transports on the proxy line only
305 ; ; applies for the global proxy, otherwise use the transport= option
306 ;matchexterniplocally = yes ; Only substitute the externip or externhost setting if it matches
307 ; your localnet setting. Unless you have some sort of strange network
308 ; setup you will not need to enable this.
310 ;dynamic_exclude_static = yes ; Disallow all dynamic hosts from registering
311 ; as any IP address used for staticly defined
312 ; hosts. This helps avoid the configuration
313 ; error of allowing your users to register at
314 ; the same address as a SIP provider.
316 ;contactdeny=0.0.0.0/0.0.0.0 ; Use contactpermit and contactdeny to
317 ;contactpermit=172.16.0.0/255.255.0.0 ; restrict at what IPs your users may
318 ; register their phones.
320 ;engine=asterisk ; RTP engine to use when communicating with the device
323 ; If regcontext is specified, Asterisk will dynamically create and destroy a
324 ; NoOp priority 1 extension for a given peer who registers or unregisters with
325 ; us and have a "regexten=" configuration item.
326 ; Multiple contexts may be specified by separating them with '&'. The
327 ; actual extension is the 'regexten' parameter of the registering peer or its
328 ; name if 'regexten' is not provided. If more than one context is provided,
329 ; the context must be specified within regexten by appending the desired
330 ; context after '@'. More than one regexten may be supplied if they are
331 ; separated by '&'. Patterns may be used in regexten.
333 ;regcontext=sipregistrations
334 ;regextenonqualify=yes ; Default "no"
335 ; If you have qualify on and the peer becomes unreachable
336 ; this setting will enforce inactivation of the regexten
337 ; extension for the peer
339 ;--------------------------- SIP timers ----------------------------------------------------
340 ; These timers are used primarily in INVITE transactions.
341 ; The default for Timer T1 is 500 ms or the measured run-trip time between
342 ; Asterisk and the device if you have qualify=yes for the device.
344 ;t1min=100 ; Minimum roundtrip time for messages to monitored hosts
346 ;timert1=500 ; Default T1 timer
347 ; Defaults to 500 ms or the measured round-trip
348 ; time to a peer (qualify=yes).
349 ;timerb=32000 ; Call setup timer. If a provisional response is not received
350 ; in this amount of time, the call will autocongest
351 ; Defaults to 64*timert1
353 ;--------------------------- RTP timers ----------------------------------------------------
354 ; These timers are currently used for both audio and video streams. The RTP timeouts
355 ; are only applied to the audio channel.
356 ; The settings are settable in the global section as well as per device
358 ;rtptimeout=60 ; Terminate call if 60 seconds of no RTP or RTCP activity
359 ; on the audio channel
360 ; when we're not on hold. This is to be able to hangup
361 ; a call in the case of a phone disappearing from the net,
362 ; like a powerloss or grandma tripping over a cable.
363 ;rtpholdtimeout=300 ; Terminate call if 300 seconds of no RTP or RTCP activity
364 ; on the audio channel
365 ; when we're on hold (must be > rtptimeout)
366 ;rtpkeepalive=<secs> ; Send keepalives in the RTP stream to keep NAT open
367 ; (default is off - zero)
369 ;--------------------------- SIP Session-Timers (RFC 4028)------------------------------------
370 ; SIP Session-Timers provide an end-to-end keep-alive mechanism for active SIP sessions.
371 ; This mechanism can detect and reclaim SIP channels that do not terminate through normal
372 ; signaling procedures. Session-Timers can be configured globally or at a user/peer level.
373 ; The operation of Session-Timers is driven by the following configuration parameters:
375 ; * session-timers - Session-Timers feature operates in the following three modes:
376 ; originate : Request and run session-timers always
377 ; accept : Run session-timers only when requested by other UA
378 ; refuse : Do not run session timers in any case
379 ; The default mode of operation is 'accept'.
380 ; * session-expires - Maximum session refresh interval in seconds. Defaults to 1800 secs.
381 ; * session-minse - Minimum session refresh interval in seconds. Defualts to 90 secs.
382 ; * session-refresher - The session refresher (uac|uas). Defaults to 'uas'.
384 ;session-timers=originate
387 ;session-refresher=uas
389 ;--------------------------- HASH TABLE SIZES ------------------------------------------------
390 ; For maximum efficiency, adjust the following
391 ; values to be slightly larger than the maximum number of in-memory objects (devices).
392 ; Too large, and space is wasted. Too small, and things will run slower.
393 ; 563 is probably way too big for small (home) applications, but it
394 ; should cover most small/medium sites.
395 ; It is recommended to make the sizes be a prime number!
396 ; This was internally set to 17 for small-memory applications...
397 ; All tables default to 563, except when compiled in LOW_MEMORY mode,
398 ; in which case, they default to 17. You can override this by uncommenting
399 ; the following, and changing the values.
404 ;--------------------------- SIP DEBUGGING ---------------------------------------------------
405 ;sipdebug = yes ; Turn on SIP debugging by default, from
406 ; the moment the channel loads this configuration
407 ;recordhistory=yes ; Record SIP history by default
408 ; (see sip history / sip no history)
409 ;dumphistory=yes ; Dump SIP history at end of SIP dialogue
410 ; SIP history is output to the DEBUG logging channel
413 ;--------------------------- STATUS NOTIFICATIONS (SUBSCRIPTIONS) ----------------------------
414 ; You can subscribe to the status of extensions with a "hint" priority
415 ; (See extensions.conf.sample for examples)
416 ; chan_sip support two major formats for notifications: dialog-info and SIMPLE
418 ; You will get more detailed reports (busy etc) if you have a call counter enabled
421 ; If you set the busylevel, we will indicate busy when we have a number of calls that
422 ; matches the busylevel treshold.
424 ; For queues, you will need this level of detail in status reporting, regardless
425 ; if you use SIP subscriptions. Queues and manager use the same internal interface
426 ; for reading status information.
428 ; Note: Subscriptions does not work if you have a realtime dialplan and use the
431 ;allowsubscribe=no ; Disable support for subscriptions. (Default is yes)
432 ;subscribecontext = default ; Set a specific context for SUBSCRIBE requests
433 ; Useful to limit subscriptions to local extensions
434 ; Settable per peer/user also
435 ;notifyringing = no ; Control whether subscriptions already INUSE get sent
436 ; RINGING when another call is sent (default: yes)
437 ;notifyhold = yes ; Notify subscriptions on HOLD state (default: no)
438 ; Turning on notifyringing and notifyhold will add a lot
439 ; more database transactions if you are using realtime.
440 ;notifycid = yes ; Control whether caller ID information is sent along with
441 ; dialog-info+xml notifications (supported by snom phones).
442 ; Note that this feature will only work properly when the
443 ; incoming call is using the same extension and context that
444 ; is being used as the hint for the called extension. This means
445 ; that it won't work when using subscribecontext for your sip
446 ; user or peer (if subscribecontext is different than context).
447 ; This is also limited to a single caller, meaning that if an
448 ; extension is ringing because multiple calls are incoming,
449 ; only one will be used as the source of caller ID. Specify
450 ; 'ignore-context' to ignore the called context when looking
451 ; for the caller's channel. The default value is 'no.' Setting
452 ; notifycid to 'ignore-context' also causes call-pickups attempted
453 ; via SNOM's NOTIFY mechanism to set the context for the call pickup
455 ;callcounter = yes ; Enable call counters on devices. This can be set per
458 ;----------------------------------------- T.38 FAX PASSTHROUGH SUPPORT -----------------------
460 ; This setting is available in the [general] section as well as in device configurations.
461 ; Setting this to yes, enables T.38 fax (UDPTL) passthrough on SIP to SIP calls, provided
462 ; both parties have T38 support enabled in their Asterisk configuration
463 ; This has to be enabled in the general section for all devices to work. You can then
464 ; disable it on a per device basis.
466 ; T.38 faxing only works in SIP to SIP calls, with no local or agent channel being used.
468 ; t38pt_udptl = yes ; Default false
470 ; Fax Detect will cause the SIP channel to jump to the 'fax' extension (if it exists)
471 ; after T.38 is successfully negotiated.
473 ; faxdetect = yes ; Default false
475 ;----------------------------------------- OUTBOUND SIP REGISTRATIONS ------------------------
476 ; Asterisk can register as a SIP user agent to a SIP proxy (provider)
477 ; Format for the register statement is:
478 ; register => [transport://]user[:secret[:authuser]]@domain[:port][/extension][~expiry]
485 ; - the name of a peer defined below or in realtime
486 ; The domain is where you register your username, so your SIP uri you are registering to
489 ; If no extension is given, the 's' extension is used. The extension needs to
490 ; be defined in extensions.conf to be able to accept calls from this SIP proxy
493 ; A similar effect can be achieved by adding a "callbackextension" option in a peer section.
494 ; this is equivalent to having the following line in the general section:
496 ; register => username:secret@host/callbackextension
498 ; and more readable because you don't have to write the parameters in two places
499 ; (note that the "port" is ignored - this is a bug that should be fixed).
501 ; Note that a register= line doesn't mean that we will match the incoming call in any
502 ; other way than described above. If you want to control where the call enters your
503 ; dialplan, which context, you want to define a peer with the hostname of the provider's
504 ; server. If the provider has multiple servers to place calls to your system, you need
505 ; a peer for each server.
507 ; Beginning with Asterisk version 1.6.2, the "user" portion of the register line may
508 ; contain a port number. Since the logical separator between a host and port number is a
509 ; ':' character, and this character is already used to separate between the optional "secret"
510 ; and "authuser" portions of the line, there is a bit of a hoop to jump through if you wish
511 ; to use a port here. That is, you must explicitly provide a "secret" and "authuser" even if
512 ; they are blank. See the third example below for an illustration.
517 ;register => 1234:password@mysipprovider.com
519 ; This will pass incoming calls to the 's' extension
522 ;register => 2345:password@sip_proxy/1234
524 ; Register 2345 at sip provider 'sip_proxy'. Calls from this provider
525 ; connect to local extension 1234 in extensions.conf, default context,
526 ; unless you configure a [sip_proxy] section below, and configure a
528 ; Tip 1: Avoid assigning hostname to a sip.conf section like [provider.com]
529 ; Tip 2: Use separate inbound and outbound sections for SIP providers
530 ; (instead of type=friend) if you have calls in both directions
532 ;register => 3456@mydomain:5082::@mysipprovider.com
534 ; Note that in this example, the optional authuser and secret portions have
535 ; been left blank because we have specified a port in the user section
537 ;registertimeout=20 ; retry registration calls every 20 seconds (default)
538 ;registerattempts=10 ; Number of registration attempts before we give up
539 ; 0 = continue forever, hammering the other server
540 ; until it accepts the registration
541 ; Default is 0 tries, continue forever
542 ;----------------------------------------- OUTBOUND MWI SUBSCRIPTIONS -------------------------
543 ; Asterisk can subscribe to receive the MWI from another SIP server and store it locally for retrieval
545 ; Format for the mwi register statement is:
546 ; mwi => user[:secret[:authuser]]@host[:port][/mailbox]
549 ;mwi => 1234:password@mysipprovider.com/1234
551 ; MWI received will be stored in the 1234 mailbox of the SIP_Remote context. It can be used by other phones by following the below:
552 ; mailbox=1234@SIP_Remote
553 ;----------------------------------------- NAT SUPPORT ------------------------
555 ; WARNING: SIP operation behind a NAT is tricky and you really need
556 ; to read and understand well the following section.
558 ; When Asterisk is behind a NAT device, the "local" address (and port) that
559 ; a socket is bound to has different values when seen from the inside or
560 ; from the outside of the NATted network. Unfortunately this address must
561 ; be communicated to the outside (e.g. in SIP and SDP messages), and in
562 ; order to determine the correct value Asterisk needs to know:
564 ; + whether it is talking to someone "inside" or "outside" of the NATted network.
565 ; This is configured by assigning the "localnet" parameter with a list
566 ; of network addresses that are considered "inside" of the NATted network.
567 ; IF LOCALNET IS NOT SET, THE EXTERNAL ADDRESS WILL NOT BE SET CORRECTLY.
568 ; Multiple entries are allowed, e.g. a reasonable set is the following:
570 ; localnet=192.168.0.0/255.255.0.0 ; RFC 1918 addresses
571 ; localnet=10.0.0.0/255.0.0.0 ; Also RFC1918
572 ; localnet=172.16.0.0/12 ; Another RFC1918 with CIDR notation
573 ; localnet=169.254.0.0/255.255.0.0 ; Zero conf local network
575 ; + the "externally visible" address and port number to be used when talking
576 ; to a host outside the NAT. This information is derived by one of the
577 ; following (mutually exclusive) config file parameters:
579 ; a. "externip = hostname[:port]" specifies a static address[:port] to
580 ; be used in SIP and SDP messages.
581 ; The hostname is looked up only once, when [re]loading sip.conf .
582 ; If a port number is not present, use the "bindport" value (which is
583 ; not guaranteed to work correctly, because a NAT box might remap the
584 ; port number as well as the address).
585 ; This approach can be useful if you have a NAT device where you can
586 ; configure the mapping statically. Examples:
588 ; externip = 12.34.56.78 ; use this address.
589 ; externip = 12.34.56.78:9900 ; use this address and port.
590 ; externip = mynat.my.org:12600 ; Public address of my nat box.
592 ; b. "externhost = hostname[:port]" is similar to "externip" except
593 ; that the hostname is looked up every "externrefresh" seconds
594 ; (default 10s). This can be useful when your NAT device lets you choose
595 ; the port mapping, but the IP address is dynamic.
596 ; Beware, you might suffer from service disruption when the name server
597 ; resolution fails. Examples:
599 ; externhost=foo.dyndns.net ; refreshed periodically
600 ; externrefresh=180 ; change the refresh interval
602 ; c. "stunaddr = stun.server[:port]" queries the STUN server specified
603 ; as an argument to obtain the external address/port.
604 ; Queries are also sent periodically every "externrefresh" seconds
605 ; (as a side effect, sending the query also acts as a keepalive for
606 ; the state entry on the nat box):
608 ; stunaddr = foo.stun.com:3478
611 ; Note that at the moment all these mechanism work only for the SIP socket.
612 ; The IP address discovered with externip/externhost/STUN is reused for
613 ; media sessions as well, but the port numbers are not remapped so you
614 ; may still experience problems.
616 ; NOTE 1: in some cases, NAT boxes will use different port numbers in
617 ; the internal<->external mapping. In these cases, the "externip" and
618 ; "externhost" might not help you configure addresses properly, and you
619 ; really need to use STUN.
621 ; NOTE 2: when using "externip" or "externhost", the address part is
622 ; also used as the external address for media sessions.
623 ; If you use "stunaddr", STUN queries will be sent to the same server
624 ; also from media sockets, and this should permit a correct mapping of
625 ; the port numbers as well.
627 ; In addition to the above, Asterisk has an additional "nat" parameter to
628 ; address NAT-related issues in incoming SIP or media sessions.
629 ; In particular, depending on the 'nat= ' settings described below, Asterisk
630 ; may override the address/port information specified in the SIP/SDP messages,
631 ; and use the information (sender address) supplied by the network stack instead.
632 ; However, this is only useful if the external traffic can reach us.
633 ; The following settings are allowed (both globally and in individual sections):
635 ; nat = no ; default. Use NAT mode only according to RFC3581 (;rport)
636 ; nat = yes ; Always ignore info and assume NAT
637 ; nat = never ; Never attempt NAT mode or RFC3581 support
638 ; nat = route ; route = Assume NAT, don't send rport
639 ; ; (work around more UNIDEN bugs)
641 ;----------------------------------- MEDIA HANDLING --------------------------------
642 ; By default, Asterisk tries to re-invite the audio to an optimal path. If there's
643 ; no reason for Asterisk to stay in the media path, the media will be redirected.
644 ; This does not really work with in the case where Asterisk is outside and have
645 ; clients on the inside of a NAT. In that case, you want to set canreinvite=nonat
647 ;canreinvite=yes ; Asterisk by default tries to redirect the
648 ; RTP media stream (audio) to go directly from
649 ; the caller to the callee. Some devices do not
650 ; support this (especially if one of them is behind a NAT).
651 ; The default setting is YES. If you have all clients
652 ; behind a NAT, or for some other reason wants Asterisk to
653 ; stay in the audio path, you may want to turn this off.
655 ; This setting also affect direct RTP
656 ; at call setup (a new feature in 1.4 - setting up the
657 ; call directly between the endpoints instead of sending
660 ;directrtpsetup=yes ; Enable the new experimental direct RTP setup. This sets up
661 ; the call directly with media peer-2-peer without re-invites.
662 ; Will not work for video and cases where the callee sends
663 ; RTP payloads and fmtp headers in the 200 OK that does not match the
664 ; callers INVITE. This will also fail if canreinvite is enabled when
665 ; the device is actually behind NAT.
667 ;canreinvite=nonat ; An additional option is to allow media path redirection
668 ; (reinvite) but only when the peer where the media is being
669 ; sent is known to not be behind a NAT (as the RTP core can
670 ; determine it based on the apparent IP address the media
673 ;canreinvite=update ; Yet a third option... use UPDATE for media path redirection,
674 ; instead of INVITE. This can be combined with 'nonat', as
675 ; 'canreinvite=update,nonat'. It implies 'yes'.
677 ;ignoresdpversion=yes ; By default, Asterisk will honor the session version
678 ; number in SDP packets and will only modify the SDP
679 ; session if the version number changes. This option will
680 ; force asterisk to ignore the SDP session version number
681 ; and treat all SDP data as new data. This is required
682 ; for devices that send us non standard SDP packets
683 ; (observed with Microsoft OCS). By default this option is
686 ;----------------------------------------- REALTIME SUPPORT ------------------------
687 ; For additional information on ARA, the Asterisk Realtime Architecture,
688 ; please read realtime.txt and extconfig.txt in the /doc directory of the
691 ;rtcachefriends=yes ; Cache realtime friends by adding them to the internal list
692 ; just like friends added from the config file only on a
693 ; as-needed basis? (yes|no)
695 ;rtsavesysname=yes ; Save systemname in realtime database at registration
698 ;rtupdate=yes ; Send registry updates to database using realtime? (yes|no)
699 ; If set to yes, when a SIP UA registers successfully, the ip address,
700 ; the origination port, the registration period, and the username of
701 ; the UA will be set to database via realtime.
702 ; If not present, defaults to 'yes'. Note: realtime peers will
703 ; probably not function across reloads in the way that you expect, if
704 ; you turn this option off.
705 ;rtautoclear=yes ; Auto-Expire friends created on the fly on the same schedule
706 ; as if it had just registered? (yes|no|<seconds>)
707 ; If set to yes, when the registration expires, the friend will
708 ; vanish from the configuration until requested again. If set
709 ; to an integer, friends expire within this number of seconds
710 ; instead of the registration interval.
712 ;ignoreregexpire=yes ; Enabling this setting has two functions:
714 ; For non-realtime peers, when their registration expires, the
715 ; information will _not_ be removed from memory or the Asterisk database
716 ; if you attempt to place a call to the peer, the existing information
717 ; will be used in spite of it having expired
719 ; For realtime peers, when the peer is retrieved from realtime storage,
720 ; the registration information will be used regardless of whether
721 ; it has expired or not; if it expires while the realtime peer
722 ; is still in memory (due to caching or other reasons), the
723 ; information will not be removed from realtime storage
725 ;----------------------------------------- SIP DOMAIN SUPPORT ------------------------
726 ; Incoming INVITE and REFER messages can be matched against a list of 'allowed'
727 ; domains, each of which can direct the call to a specific context if desired.
728 ; By default, all domains are accepted and sent to the default context or the
729 ; context associated with the user/peer placing the call.
730 ; REGISTER to non-local domains will be automatically denied if a domain
731 ; list is configured.
733 ; Domains can be specified using:
734 ; domain=<domain>[,<context>]
736 ; domain=myasterisk.dom
737 ; domain=customer.com,customer-context
739 ; In addition, all the 'default' domains associated with a server should be
740 ; added if incoming request filtering is desired.
743 ; To disallow requests for domains not serviced by this server:
744 ; allowexternaldomains=no
746 ;domain=mydomain.tld,mydomain-incoming
747 ; Add domain and configure incoming context
748 ; for external calls to this domain
749 ;domain=1.2.3.4 ; Add IP address as local domain
750 ; You can have several "domain" settings
751 ;allowexternaldomains=no ; Disable INVITE and REFER to non-local domains
753 ;autodomain=yes ; Turn this on to have Asterisk add local host
754 ; name and local IP to domain list.
756 ; fromdomain=mydomain.tld ; When making outbound SIP INVITEs to
757 ; non-peers, use your primary domain "identity"
758 ; for From: headers instead of just your IP
759 ; address. This is to be polite and
760 ; it may be a mandatory requirement for some
761 ; destinations which do not have a prior
762 ; account relationship with your server.
764 ;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
765 ; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a
766 ; SIP channel. Defaults to "no". An enabled jitterbuffer will
767 ; be used only if the sending side can create and the receiving
768 ; side can not accept jitter. The SIP channel can accept jitter,
769 ; thus a jitterbuffer on the receive SIP side will be used only
770 ; if it is forced and enabled.
772 ; jbforce = no ; Forces the use of a jitterbuffer on the receive side of a SIP
773 ; channel. Defaults to "no".
775 ; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds.
777 ; jbresyncthreshold = 1000 ; Jump in the frame timestamps over which the jitterbuffer is
778 ; resynchronized. Useful to improve the quality of the voice, with
779 ; big jumps in/broken timestamps, usually sent from exotic devices
780 ; and programs. Defaults to 1000.
782 ; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a SIP
783 ; channel. Two implementations are currently available - "fixed"
784 ; (with size always equals to jbmaxsize) and "adaptive" (with
785 ; variable size, actually the new jb of IAX2). Defaults to fixed.
787 ; jblog = no ; Enables jitterbuffer frame logging. Defaults to "no".
788 ;-----------------------------------------------------------------------------------
791 ; Global credentials for outbound calls, i.e. when a proxy challenges your
792 ; Asterisk server for authentication. These credentials override
793 ; any credentials in peer/register definition if realm is matched.
795 ; This way, Asterisk can authenticate for outbound calls to other
796 ; realms. We match realm on the proxy challenge and pick an set of
797 ; credentials from this list
799 ; auth = <user>:<secret>@<realm>
800 ; auth = <user>#<md5secret>@<realm>
802 ;auth=mark:topsecret@digium.com
804 ; You may also add auth= statements to [peer] definitions
805 ; Peer auth= override all other authentication settings if we match on realm
807 ;------------------------------------------------------------------------------
808 ; DEVICE CONFIGURATION
810 ; The SIP channel has two types of devices, the friend and the peer.
811 ; * The type=friend is a device type that accepts both incoming and outbound calls,
812 ; where Asterisk match on the From: username on incoming calls.
813 ; (A synonym for friend is "user"). This is a type you use for your local
815 ; * The type=peer also handles both incoming and outbound calls. On inbound calls,
816 ; Asterisk only matches on IP/port, not on names. This is mostly used for SIP
819 ; For device names, we recommend using only a-z, numerics (0-9) and underscore
821 ; For local phones, type=friend works most of the time
823 ; If you have one-way audio, you probably have NAT problems.
824 ; If Asterisk is on a public IP, and the phone is inside of a NAT device
825 ; you will need to configure nat option for those phones.
826 ; Also, turn on qualify=yes to keep the nat session open
828 ; Configuration options available
829 ; --------------------
891 ; contactpermit ; Limit what a host may register as (a neat trick
892 ; contactdeny ; is to register at the same IP as a SIP provider,
893 ; ; then call oneself, and get redirected to that
897 ; For incoming calls only. Example: FWD (Free World Dialup)
898 ; We match on IP address of the proxy for incoming calls
899 ; since we can not match on username (caller id)
905 ;type=peer ; we only want to call out, not be called
906 ;remotesecret=guessit ; Our password to their service
907 ;defaultuser=yourusername ; Authentication user for outbound proxies
908 ;fromuser=yourusername ; Many SIP providers require this!
909 ;fromdomain=provider.sip.domain
910 ;host=box.provider.com
911 ;transport=udp,tcp ; This sets the default transport type to udp for outgoing, and will
912 ; ; accept both tcp and udp. The default transport type is only used for
913 ; ; outbound messages until a Registration takes place. During the
914 ; ; peer Registration the transport type may change to another supported
915 ; ; type if the peer requests so.
917 ;usereqphone=yes ; This provider requires ";user=phone" on URI
918 ;callcounter=yes ; Enable call counter
919 ;busylevel=2 ; Signal busy at 2 or more calls
920 ;outboundproxy=proxy.provider.domain ; send outbound signaling to this proxy, not directly to the peer
921 ;port=80 ; The port number we want to connect to on the remote side
922 ; Also used as "defaultport" in combination with "defaultip" settings
924 ;--- sample definition for a provider
927 ;host=sip.provider1.com
928 ;fromuser=4015552299 ; how your provider knows you
929 ;remotesecret=youwillneverguessit ; The password we use to authenticate to them
930 ;secret=gissadetdu ; The password they use to contact us
931 ;callbackextension=123 ; Register with this server and require calls coming back to this extension
932 ;transport=udp,tcp ; This sets the transport type to udp for outgoing, and will
933 ; ; accept both tcp and udp. Default is udp. The first transport
934 ; ; listed will always be used for outgoing connections.
937 ; Because you might have a large number of similar sections, it is generally
938 ; convenient to use templates for the common parameters, and add them
939 ; the the various sections. Examples are below, and we can even leave
940 ; the templates uncommented as they will not harm:
942 [basic-options](!) ; a template
947 [natted-phone](!,basic-options) ; another template inheriting basic-options
952 [public-phone](!,basic-options) ; another template inheriting basic-options
956 [my-codecs](!) ; a template for my preferred codecs
964 [ulaw-phone](!) ; and another one for ulaw-only
968 ; and finally instantiate a few phones
970 ; [2133](natted-phone,my-codecs)
972 ; [2134](natted-phone,ulaw-phone)
973 ; secret = not_very_secret
974 ; [2136](public-phone,ulaw-phone)
975 ; secret = not_very_secret_either
979 ; Standard configurations not using templates look like this:
983 ;context=from-sip ; Where to start in the dialplan when this phone calls
984 ;callerid=John Doe <1234> ; Full caller ID, to override the phones config
985 ; on incoming calls to Asterisk
986 ;host=192.168.0.23 ; we have a static but private IP address
987 ; No registration allowed
988 ;nat=no ; there is not NAT between phone and Asterisk
989 ;canreinvite=yes ; allow RTP voice traffic to bypass Asterisk
990 ;dtmfmode=info ; either RFC2833 or INFO for the BudgeTone
991 ;call-limit=1 ; permit only 1 outgoing call and 1 incoming call at a time
992 ; from the phone to asterisk (deprecated)
993 ; 1 for the explicit peer, 1 for the explicit user,
994 ; remember that a friend equals 1 peer and 1 user in
996 ; There is no combined call counter for a "friend"
997 ; so there's currently no way in sip.conf to limit
998 ; to one inbound or outbound call per phone. Use
999 ; the group counters in the dial plan for that.
1001 ;mailbox=1234@default ; mailbox 1234 in voicemail context "default"
1002 ;disallow=all ; need to disallow=all before we can use allow=
1003 ;allow=ulaw ; Note: In user sections the order of codecs
1004 ; listed with allow= does NOT matter!
1006 ;allow=g723.1 ; Asterisk only supports g723.1 pass-thru!
1007 ;allow=g729 ; Pass-thru only unless g729 license obtained
1008 ;callingpres=allowed_passed_screen ; Set caller ID presentation
1009 ; See README.callingpres for more information
1012 ; Turn off silence suppression in X-Lite ("Transmit Silence"=YES)!
1013 ; Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
1015 ;regexten=1234 ; When they register, create extension 1234
1016 ;callerid="Jane Smith" <5678>
1017 ;host=dynamic ; This device needs to register
1018 ;nat=yes ; X-Lite is behind a NAT router
1019 ;canreinvite=no ; Typically set to NO if behind NAT
1021 ;allow=gsm ; GSM consumes far less bandwidth than ulaw
1024 ;mailbox=1234@default,1233@default ; Subscribe to status of multiple mailboxes
1025 ;registertrying=yes ; Send a 100 Trying when the device registers.
1028 ;type=friend ; Friends place calls and receive calls
1029 ;context=from-sip ; Context for incoming calls from this user
1031 ;subscribecontext=localextensions ; Only allow SUBSCRIBE for local extensions
1032 ;language=de ; Use German prompts for this user
1033 ;host=dynamic ; This peer register with us
1034 ;dtmfmode=inband ; Choices are inband, rfc2833, or info
1035 ;defaultip=192.168.0.59 ; IP used until peer registers
1036 ;mailbox=1234@context,2345 ; Mailbox(-es) for message waiting indicator
1037 ;subscribemwi=yes ; Only send notifications if this phone
1038 ; subscribes for mailbox notification
1039 ;vmexten=voicemail ; dialplan extension to reach mailbox
1040 ; sets the Message-Account in the MWI notify message
1041 ; defaults to global vmexten which defaults to "asterisk"
1043 ;allow=ulaw ; dtmfmode=inband only works with ulaw or alaw!
1047 ;type=friend ; Friends place calls and receive calls
1048 ;context=from-sip ; Context for incoming calls from this user
1050 ;host=dynamic ; This peer register with us
1051 ;dtmfmode=rfc2833 ; Choices are inband, rfc2833, or info
1052 ;defaultuser=polly ; Username to use in INVITE until peer registers
1053 ;defaultip=192.168.40.123
1054 ; Normally you do NOT need to set this parameter
1056 ;allow=ulaw ; dtmfmode=inband only works with ulaw or alaw!
1057 ;progressinband=no ; Polycom phones don't work properly with "never"
1064 ;insecure=port ; Allow matching of peer by IP address without
1065 ; matching port number
1066 ;insecure=invite ; Do not require authentication of incoming INVITEs
1067 ;insecure=port,invite ; (both)
1068 ;qualify=1000 ; Consider it down if it's 1 second to reply
1069 ; Helps with NAT session
1070 ; qualify=yes uses default value
1071 ;qualifyfreq=60 ; Qualification: How often to check for the
1072 ; host to be up in seconds
1073 ; Set to low value if you use low timeout for
1074 ; NAT of UDP sessions
1076 ; Call group and Pickup group should be in the range from 0 to 63
1078 ;callgroup=1,3-4 ; We are in caller groups 1,3,4
1079 ;pickupgroup=1,3-5 ; We can do call pick-p for call group 1,3,4,5
1080 ;defaultip=192.168.0.60 ; IP address to use if peer has not registered
1081 ;deny=0.0.0.0/0.0.0.0 ; ACL: Control access to this account based on IP address
1082 ;permit=192.168.0.60/255.255.255.0
1087 ;qualify=200 ; Qualify peer is no more than 200ms away
1088 ;nat=yes ; This phone may be natted
1089 ; Send SIP and RTP to the IP address that packet is
1090 ; received from instead of trusting SIP headers
1091 ;host=dynamic ; This device registers with us
1092 ;canreinvite=no ; Asterisk by default tries to redirect the
1093 ; RTP media stream (audio) to go directly from
1094 ; the caller to the callee. Some devices do not
1095 ; support this (especially if one of them is
1097 ;defaultip=192.168.0.4 ; IP address to use until registration
1098 ;defaultuser=goran ; Username to use when calling this device before registration
1099 ; Normally you do NOT need to set this parameter
1100 ;setvar=CUSTID=5678 ; Channel variable to be set for all calls from or to this device
1101 ;setvar=ATTENDED_TRANSFER_COMPLETE_SOUND=beep ; This channel variable will
1102 ; cause the given audio file to
1103 ; be played upon completion of
1104 ; an attended transfer.
1110 ;rfc2833compensate=yes ; Compensate for pre-1.4 DTMF transmission from another Asterisk machine.
1111 ; You must have this turned on or DTMF reception will work improperly.
1112 ;t38pt_usertpsource=yes ; Use the source IP address of RTP as the destination IP address for UDPTL packets
1113 ; if the nat option is enabled. If a single RTP packet is received Asterisk will know the
1114 ; external IP address of the remote device. If port forwarding is done at the client side
1115 ; then UDPTL will flow to the remote device.