adaptation SIP par defaut pour fonctionnent derrière NAT (ou pas)
[asterisk-config-auf.git] / etc-asterisk / sip.conf
2; SIP Configuration example for Asterisk
4; Syntax for specifying a SIP device in extensions.conf is
5; SIP/devicename where devicename is defined in a section below.
7; You may also use
8; SIP/username@domain to call any SIP user on the Internet
9; (Don't forget to enable DNS SRV records if you want to use this)
11; If you define a SIP proxy as a peer below, you may call
12; SIP/proxyhostname/user or SIP/user@proxyhostname
13; where the proxyhostname is defined in a section below
15; Useful CLI commands to check peers/users:
16; sip show peers Show all SIP peers (including friends)
17; sip show users Show all SIP users (including friends)
18; sip show registry Show status of hosts we register with
20; sip debug Show all SIP messages
22; reload Reload configuration file
23; Active SIP peers will not be reconfigured
27context=default ; Default context for incoming calls
28;allowguest=no ; Allow or reject guest calls (default is yes)
29allowoverlap=yes ; Disable overlap dialing support. (Default is yes)
30allowtransfer=yes ; Disable all transfers (unless enabled in peers or users)
31 ; Default is enabled
32;realm=mydomain.tld ; Realm for digest authentication
33 ; defaults to "asterisk". If you set a system name in
34 ; asterisk.conf, it defaults to that system name
35 ; Realms MUST be globally unique according to RFC 3261
36 ; Set this to your host name or domain name
37bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
38 ; bindport is the local UDP port that Asterisk will listen on
39bindaddr= ; IP address to bind to ( binds to all)
40srvlookup=yes ; Enable DNS SRV lookups on outbound calls
41 ; Note: Asterisk only uses the first host
42 ; in SRV records
43 ; Disabling DNS SRV lookups disables the
44 ; ability to place SIP calls based on domain
45 ; names to some other SIP users on the Internet
47;domain=mydomain.tld ; Set default domain for this host
48 ; If configured, Asterisk will only allow
49 ; INVITE and REFER to non-local domains
50 ; Use "sip show domains" to list local domains
51;pedantic=yes ; Enable checking of tags in headers,
52 ; international character conversions in URIs
53 ; and multiline formatted headers for strict
54 ; SIP compatibility (defaults to "no")
56; See doc/README.tos for a description of these parameters.
57tos_sip=cs3 ; Sets TOS for SIP packets.
58tos_audio=ef ; Sets TOS for RTP audio packets.
59tos_video=af41 ; Sets TOS for RTP video packets.
61;maxexpiry=3600 ; Maximum allowed time of incoming registrations
62 ; and subscriptions (seconds)
63;minexpiry=60 ; Minimum length of registrations/subscriptions (default 60)
64;defaultexpiry=120 ; Default length of incoming/outgoing registration
65;t1min=100 ; Minimum roundtrip time for messages to monitored hosts
66 ; Defaults to 100 ms
67;notifymimetype=text/plain ; Allow overriding of mime type in MWI NOTIFY
68;checkmwi=10 ; Default time between mailbox checks for peers
69;buggymwi=no ; Cisco SIP firmware doesn't support the MWI RFC
70 ; fully. Enable this option to not get error messages
71 ; when sending MWI to phones with this bug.
72;vmexten=voicemail ; dialplan extension to reach mailbox sets the
73 ; Message-Account in the MWI notify message
74 ; defaults to "asterisk"
75;disallow=all ; First disallow all codecs
76;allow=ulaw ; Allow codecs in order of preference
77;allow=ilbc ; see doc/rtp-packetization for framing options
88; This option specifies a preference for which music on hold class this channel
89; should listen to when put on hold if the music class has not been set on the
90; channel with Set(CHANNEL(musicclass)=whatever) in the dialplan, and the peer
91; channel putting this one on hold did not suggest a music class.
93; This option may be specified globally, or on a per-user or per-peer basis.
97; This option specifies which music on hold class to suggest to the peer channel
98; when this channel places the peer on hold. It may be specified globally or on
99; a per-user or per-peer basis.
103language=fr ; Default language setting for all users/peers
104 ; This may also be set for individual users/peers
105;relaxdtmf=yes ; Relax dtmf handling
106;trustrpid = no ; If Remote-Party-ID should be trusted
107;sendrpid = yes ; If Remote-Party-ID should be sent
108;progressinband=never ; If we should generate in-band ringing always
109 ; use 'never' to never use in-band signalling, even in cases
110 ; where some buggy devices might not render it
111 ; Valid values: yes, no, never Default: never
112;useragent=Asterisk PBX ; Allows you to change the user agent string
113;promiscredir = no ; If yes, allows 302 or REDIR to non-local SIP address
114 ; Note that promiscredir when redirects are made to the
115 ; local system will cause loops since Asterisk is incapable
116 ; of performing a "hairpin" call.
117;usereqphone = no ; If yes, ";user=phone" is added to uri that contains
118 ; a valid phone number
119;dtmfmode = rfc2833 ; Set default dtmfmode for sending DTMF. Default: rfc2833
120 ; Other options:
121 ; info : SIP INFO messages
122 ; inband : Inband audio (requires 64 kbit codec -alaw, ulaw)
123 ; auto : Use rfc2833 if offered, inband otherwise
126;compactheaders = yes ; send compact sip headers.
128videosupport=yes ; Turn on support for SIP video. You need to turn this on
129 ; in the this section to get any video support at all.
130 ; You can turn it off on a per peer basis if the general
131 ; video support is enabled, but you can't enable it for
132 ; one peer only without enabling in the general section.
133;maxcallbitrate=384 ; Maximum bitrate for video calls (default 384 kb/s)
134 ; Videosupport and maxcallbitrate is settable
135 ; for peers and users as well
136;callevents=no ; generate manager events when sip ua
137 ; performs events (e.g. hold)
138;alwaysauthreject = yes ; When an incoming INVITE or REGISTER is to be rejected,
139 ; for any reason, always reject with '401 Unauthorized'
140 ; instead of letting the requester know whether there was
141 ; a matching user or peer for their request
143;g726nonstandard = yes ; If the peer negotiates G726-32 audio, use AAL2 packing
144 ; order instead of RFC3551 packing order (this is required
145 ; for Sipura and Grandstream ATAs, among others). This is
146 ; contrary to the RFC3551 specification, the peer _should_
147 ; be negotiating AAL2-G726-32 instead :-(
149;matchexterniplocally = yes ; Only substitute the externip or externhost setting if it matches
150 ; your localnet setting. Unless you have some sort of strange network
151 ; setup you will not need to enable this.
154; If regcontext is specified, Asterisk will dynamically create and destroy a
155; NoOp priority 1 extension for a given peer who registers or unregisters with
156; us and have a "regexten=" configuration item.
157; Multiple contexts may be specified by separating them with '&'. The
158; actual extension is the 'regexten' parameter of the registering peer or its
159; name if 'regexten' is not provided. If more than one context is provided,
160; the context must be specified within regexten by appending the desired
161; context after '@'. More than one regexten may be supplied if they are
162; separated by '&'. Patterns may be used in regexten.
166;--------------------------- RTP timers ----------------------------------------------------
167; These timers are currently used for both audio and video streams. The RTP timeouts
168; are only applied to the audio channel.
169; The settings are settable in the global section as well as per device
9b6412d4 171rtptimeout=60 ; Terminate call if 60 seconds of no RTP or RTCP activity
172 ; on the audio channel
173 ; when we're not on hold. This is to be able to hangup
174 ; a call in the case of a phone disappearing from the net,
175 ; like a powerloss or grandma tripping over a cable.
9b6412d4 176rtpholdtimeout=300 ; Terminate call if 300 seconds of no RTP or RTCP activity
177 ; on the audio channel
178 ; when we're on hold (must be > rtptimeout)
9b6412d4 179rtpkeepalive=60 ; Send keepalives in the RTP stream to keep NAT open
180 ; (default is off - zero)
181;--------------------------- SIP DEBUGGING ---------------------------------------------------
182;sipdebug = yes ; Turn on SIP debugging by default, from
183 ; the moment the channel loads this configuration
184;recordhistory=yes ; Record SIP history by default
185 ; (see sip history / sip no history)
186;dumphistory=yes ; Dump SIP history at end of SIP dialogue
187 ; SIP history is output to the DEBUG logging channel
190;--------------------------- STATUS NOTIFICATIONS (SUBSCRIPTIONS) ----------------------------
191; You can subscribe to the status of extensions with a "hint" priority
192; (See extensions.conf.sample for examples)
193; chan_sip support two major formats for notifications: dialog-info and SIMPLE
195; You will get more detailed reports (busy etc) if you have a call limit set
196; for a device. When the call limit is filled, we will indicate busy. Note that
197; you need at least 2 in order to be able to do attended transfers.
199; For queues, you will need this level of detail in status reporting, regardless
200; if you use SIP subscriptions. Queues and manager use the same internal interface
201; for reading status information.
203; Note: Subscriptions does not work if you have a realtime dialplan and use the
204; realtime switch.
206;allowsubscribe=no ; Disable support for subscriptions. (Default is yes)
207;subscribecontext = default ; Set a specific context for SUBSCRIBE requests
208 ; Useful to limit subscriptions to local extensions
209 ; Settable per peer/user also
210;notifyringing = yes ; Notify subscriptions on RINGING state (default: no)
211;notifyhold = yes ; Notify subscriptions on HOLD state (default: no)
212 ; Turning on notifyringing and notifyhold will add a lot
213 ; more database transactions if you are using realtime.
214;limitonpeers = yes ; Apply call limits on peers only. This will improve
215 ; status notification when you are using type=friend
216 ; Inbound calls, that really apply to the user part
217 ; of a friend will now be added to and compared with
218 ; the peer limit instead of applying two call limits,
219 ; one for the peer and one for the user.
220 ; "sip show inuse" will only show active calls on
221 ; the peer side of a "type=friend" object if this
222 ; setting is turned on.
224;----------------------------------------- T.38 FAX PASSTHROUGH SUPPORT -----------------------
226; This setting is available in the [general] section as well as in device configurations.
227; Setting this to yes, enables T.38 fax (UDPTL) passthrough on SIP to SIP calls, provided
228; both parties have T38 support enabled in their Asterisk configuration
229; This has to be enabled in the general section for all devices to work. You can then
230; disable it on a per device basis.
232; T.38 faxing only works in SIP to SIP calls, with no local or agent channel being used.
234; t38pt_udptl = yes ; Default false
236;----------------------------------------- OUTBOUND SIP REGISTRATIONS ------------------------
237; Asterisk can register as a SIP user agent to a SIP proxy (provider)
238; Format for the register statement is:
239; register => user[:secret[:authuser]]@host[:port][/extension]
241; If no extension is given, the 's' extension is used. The extension needs to
242; be defined in extensions.conf to be able to accept calls from this SIP proxy
243; (provider).
245; host is either a host name defined in DNS or the name of a section defined
246; below.
248; Examples:
250;register =>
252; This will pass incoming calls to the 's' extension
255;register => 2345:password@sip_proxy/1234
257; Register 2345 at sip provider 'sip_proxy'. Calls from this provider
258; connect to local extension 1234 in extensions.conf, default context,
259; unless you configure a [sip_proxy] section below, and configure a
260; context.
261; Tip 1: Avoid assigning hostname to a sip.conf section like []
262; Tip 2: Use separate type=peer and type=user sections for SIP providers
263; (instead of type=friend) if you have calls in both directions
265;registertimeout=20 ; retry registration calls every 20 seconds (default)
266;registerattempts=10 ; Number of registration attempts before we give up
267 ; 0 = continue forever, hammering the other server
268 ; until it accepts the registration
269 ; Default is 0 tries, continue forever
271;----------------------------------------- NAT SUPPORT ------------------------
272; The externip, externhost and localnet settings are used if you use Asterisk
273; behind a NAT device to communicate with services on the outside.
275; si votre serveur Asterisk est derrière un système DNAT, il faut indiquer
276; ici son adresse IP publique.
278;externip = ; Address that we're going to put in outbound SIP
279 ; messages if we're behind a NAT
281 ; The externip and localnet is used
282 ; when registering and communicating with other proxies
283 ; that we're registered with
285; Si cette IP est dynamique, vous pouvez essayer d'utiliser externhost
286; et un système de type DynDNS
288; ; Alternatively you can specify an
289 ; external host, and Asterisk will
290 ; perform DNS queries periodically. Not
291 ; recommended for production
292 ; environments! Use externip instead
293;externrefresh=10 ; How often to refresh externhost if
294 ; used
295 ; You may add multiple local networks. A reasonable
296 ; set of defaults are:
298; réseaux locaux avec lesquels il ne faut pas faire de NAT
302localnet= ; ZeroConf
304; The nat= setting is used when Asterisk is on a public IP, communicating with
305; devices hidden behind a NAT device (broadband router). If you have one-way
306; audio problems, you usually have problems with your NAT configuration or your
307; firewall's support of SIP+RTP ports. You configure Asterisk choice of RTP
308; ports for incoming audio in rtp.conf
310nat=no ; Global NAT settings (Affects all peers and users)
311 ; yes = Always ignore info and assume NAT
312 ; no = Use NAT mode only according to RFC3581 (;rport)
313 ; never = Never attempt NAT mode or RFC3581 support
314 ; route = Assume NAT, don't send rport
315 ; (work around more UNIDEN bugs)
317;----------------------------------- MEDIA HANDLING --------------------------------
318; By default, Asterisk tries to re-invite the audio to an optimal path. If there's
319; no reason for Asterisk to stay in the media path, the media will be redirected.
320; This does not really work with in the case where Asterisk is outside and have
321; clients on the inside of a NAT. In that case, you want to set canreinvite=nonat
324canreinvite=no ; Asterisk reste sur le chemin du flux audio
326;canreinvite=yes ; Asterisk by default tries to redirect the
327 ; RTP media stream (audio) to go directly from
328 ; the caller to the callee. Some devices do not
329 ; support this (especially if one of them is behind a NAT).
330 ; The default setting is YES. If you have all clients
331 ; behind a NAT, or for some other reason wants Asterisk to
332 ; stay in the audio path, you may want to turn this off.
334 ; In Asterisk 1.4 this setting also affect direct RTP
335 ; at call setup (a new feature in 1.4 - setting up the
336 ; call directly between the endpoints instead of sending
337 ; a re-INVITE).
339;directrtpsetup=yes ; Enable the new experimental direct RTP setup. This sets up
340 ; the call directly with media peer-2-peer without re-invites.
341 ; Will not work for video and cases where the callee sends
342 ; RTP payloads and fmtp headers in the 200 OK that does not match the
343 ; callers INVITE. This will also fail if canreinvite is enabled when
344 ; the device is actually behind NAT.
346;canreinvite=nonat ; An additional option is to allow media path redirection
347 ; (reinvite) but only when the peer where the media is being
348 ; sent is known to not be behind a NAT (as the RTP core can
349 ; determine it based on the apparent IP address the media
350 ; arrives from).
352;canreinvite=update ; Yet a third option... use UPDATE for media path redirection,
353 ; instead of INVITE. This can be combined with 'nonat', as
354 ; 'canreinvite=update,nonat'. It implies 'yes'.
356;----------------------------------------- REALTIME SUPPORT ------------------------
357; For additional information on ARA, the Asterisk Realtime Architecture,
358; please read realtime.txt and extconfig.txt in the /doc directory of the
359; source code.
361;rtcachefriends=yes ; Cache realtime friends by adding them to the internal list
362 ; just like friends added from the config file only on a
363 ; as-needed basis? (yes|no)
365;rtsavesysname=yes ; Save systemname in realtime database at registration
366 ; Default= no
368;rtupdate=yes ; Send registry updates to database using realtime? (yes|no)
369 ; If set to yes, when a SIP UA registers successfully, the ip address,
370 ; the origination port, the registration period, and the username of
371 ; the UA will be set to database via realtime.
372 ; If not present, defaults to 'yes'.
373;rtautoclear=yes ; Auto-Expire friends created on the fly on the same schedule
374 ; as if it had just registered? (yes|no|<seconds>)
375 ; If set to yes, when the registration expires, the friend will
376 ; vanish from the configuration until requested again. If set
377 ; to an integer, friends expire within this number of seconds
378 ; instead of the registration interval.
380;ignoreregexpire=yes ; Enabling this setting has two functions:
381 ;
382 ; For non-realtime peers, when their registration expires, the
383 ; information will _not_ be removed from memory or the Asterisk database
384 ; if you attempt to place a call to the peer, the existing information
385 ; will be used in spite of it having expired
386 ;
387 ; For realtime peers, when the peer is retrieved from realtime storage,
388 ; the registration information will be used regardless of whether
389 ; it has expired or not; if it expires while the realtime peer
390 ; is still in memory (due to caching or other reasons), the
391 ; information will not be removed from realtime storage
393;----------------------------------------- SIP DOMAIN SUPPORT ------------------------
394; Incoming INVITE and REFER messages can be matched against a list of 'allowed'
395; domains, each of which can direct the call to a specific context if desired.
396; By default, all domains are accepted and sent to the default context or the
397; context associated with the user/peer placing the call.
398; Domains can be specified using:
399; domain=<domain>[,<context>]
400; Examples:
401; domain=myasterisk.dom
404; In addition, all the 'default' domains associated with a server should be
405; added if incoming request filtering is desired.
406; autodomain=yes
408; To disallow requests for domains not serviced by this server:
409; allowexternaldomains=no
412 ; Add domain and configure incoming context
413 ; for external calls to this domain
414;domain= ; Add IP address as local domain
415 ; You can have several "domain" settings
416;allowexternaldomains=no ; Disable INVITE and REFER to non-local domains
417 ; Default is yes
418;autodomain=yes ; Turn this on to have Asterisk add local host
419 ; name and local IP to domain list.
421; fromdomain=mydomain.tld ; When making outbound SIP INVITEs to
422 ; non-peers, use your primary domain "identity"
423 ; for From: headers instead of just your IP
424 ; address. This is to be polite and
425 ; it may be a mandatory requirement for some
426 ; destinations which do not have a prior
427 ; account relationship with your server.
429;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
430jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a
431 ; SIP channel. Defaults to "no". An enabled jitterbuffer will
432 ; be used only if the sending side can create and the receiving
433 ; side can not accept jitter. The SIP channel can accept jitter,
434 ; thus a jitterbuffer on the receive SIP side will be used only
435 ; if it is forced and enabled.
437; jbforce = no ; Forces the use of a jitterbuffer on the receive side of a SIP
438 ; channel. Defaults to "no".
440jbmaxsize = 500 ; Max length of the jitterbuffer in milliseconds.
442; jbresyncthreshold = 1000 ; Jump in the frame timestamps over which the jitterbuffer is
443 ; resynchronized. Useful to improve the quality of the voice, with
444 ; big jumps in/broken timestamps, usually sent from exotic devices
445 ; and programs. Defaults to 1000.
447; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a SIP
448 ; channel. Two implementations are currently available - "fixed"
449 ; (with size always equals to jbmaxsize) and "adaptive" (with
450 ; variable size, actually the new jb of IAX2). Defaults to fixed.
452; jblog = no ; Enables jitterbuffer frame logging. Defaults to "no".
456; Global credentials for outbound calls, i.e. when a proxy challenges your
457; Asterisk server for authentication. These credentials override
458; any credentials in peer/register definition if realm is matched.
460; This way, Asterisk can authenticate for outbound calls to other
461; realms. We match realm on the proxy challenge and pick an set of
462; credentials from this list
463; Syntax:
464; auth = <user>:<secret>@<realm>
465; auth = <user>#<md5secret>@<realm>
466; Example:
469; You may also add auth= statements to [peer] definitions
470; Peer auth= override all other authentication settings if we match on realm
473; Users and peers have different settings available. Friends have all settings,
474; since a friend is both a peer and a user
476; User config options: Peer configuration:
477; -------------------- -------------------
478; context context
479; callingpres callingpres
480; permit permit
481; deny deny
482; secret secret
483; md5secret md5secret
484; dtmfmode dtmfmode
485; canreinvite canreinvite
486; nat nat
487; callgroup callgroup
488; pickupgroup pickupgroup
489; language language
490; allow allow
491; disallow disallow
492; insecure insecure
493; trustrpid trustrpid
494; progressinband progressinband
495; promiscredir promiscredir
496; useclientcode useclientcode
497; accountcode accountcode
498; setvar setvar
499; callerid callerid
500; amaflags amaflags
501; call-limit call-limit
502; allowoverlap allowoverlap
503; allowsubscribe allowsubscribe
504; allowtransfer allowtransfer
505; subscribecontext subscribecontext
506; videosupport videosupport
507; maxcallbitrate maxcallbitrate
508; rfc2833compensate mailbox
509; username
510; template
511; fromdomain
512; regexten
513; fromuser
514; host
515; port
516; qualify
517; defaultip
518; rtptimeout
519; rtpholdtimeout
520; sendrpid
521; outboundproxy
522; rfc2833compensate
525; For incoming calls only. Example: FWD (Free World Dialup)
526; We match on IP address of the proxy for incoming calls
527; since we can not match on username (caller id)
533;type=peer ; we only want to call out, not be called
535;username=yourusername ; Authentication user for outbound proxies
536;fromuser=yourusername ; Many SIP providers require this!
539;usereqphone=yes ; This provider requires ";user=phone" on URI
540;call-limit=5 ; permit only 5 simultaneous outgoing calls to this peer
541;outboundproxy=proxy.provider.domain ; send outbound signaling to this proxy, not directly to the peer
542 ; Call-limits will not be enforced on real-time peers,
543 ; since they are not stored in-memory
544;port=80 ; The port number we want to connect to on the remote side
545 ; Also used as "defaultport" in combination with "defaultip" settings
548; Definitions of locally connected SIP devices
550; type = user a device that authenticates to us by "from" field to place calls
551; type = peer a device we place calls to or that calls us and we match by host
552; type = friend two configurations (peer+user) in one
554; For device names, we recommend using only a-z, numerics (0-9) and underscore
556; For local phones, type=friend works most of the time
558; If you have one-way audio, you probably have NAT problems.
559; If Asterisk is on a public IP, and the phone is inside of a NAT device
560; you will need to configure nat option for those phones.
561; Also, turn on qualify=yes to keep the nat session open
565; Pont "Codian" CERN/CNRS/IN2P3/Inserm/INRA pour extension *341
581; AUF
584; Comptes pour postes clients locaux SIP
585#include "auf/sip.local"