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