Add user=phone option (bug #2244, thanks oej)
[asterisk/asterisk.git] / configs / sip.conf.sample
1 ;
2 ; SIP Configuration for Asterisk
3 ;
4 ; Syntax for specifying a SIP device in extensions.conf is
5 ; SIP/devicename where devicename is defined in a section below.
6 ;
7 ; You may also use 
8 ; SIP/username@domain to call any SIP user on the Internet
9 ; (Don't forget to enable DNS SRV records if you want to use this)
10
11 ; If you define a SIP proxy as a peer below, you may call
12 ; SIP/proxyhostname/user or SIP/user@proxyhostname 
13 ; where the proxyhostname is defined in a section below 
14
15 ; Useful CLI commands to check peers/users:
16 ;   sip show peers              Show all SIP peers (including friends)
17 ;   sip show users              Show all SIP users (including friends)
18 ;   sip show registry           Show status of hosts we register with
19 ;
20 ;   sip debug                   Show all SIP messages
21 ;
22
23 [general]
24 context=default                 ; Default context for incoming calls
25 ;recordhistory=yes              ; Record SIP history by default 
26                                 ; (see sip history / sip no history)
27 ;realm=mydomain.tld             ; Realm for digest authentication
28                                 ; defaults to "asterisk"
29                                 ; Realms MUST be globally unique according to RFC 3261
30                                 ; Set this to your host name or domain name
31 port=5060                       ; UDP Port to bind to (SIP standard port is 5060)
32 bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to all)
33 srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
34                                 ; Note: Asterisk only uses the first host 
35                                 ; in SRV records
36                                 ; Disabling DNS SRV lookups disables the 
37                                 ; ability to place SIP calls based on domain 
38                                 ; names to some other SIP users on the Internet
39                                 
40 ;pedantic=yes                   ; Enable slow, pedantic checking for Pingtel
41                                 ; and multiline formatted headers for strict
42                                 ; SIP compatibility (defaults to "no")
43 ;tos=184                        ; Set IP QoS to either a keyword or numeric val
44 ;tos=lowdelay                   ; lowdelay,throughput,reliability,mincost,none
45 ;maxexpirey=3600                ; Max length of incoming registration we allow
46 ;defaultexpirey=120             ; Default length of incoming/outoing registration
47 ;notifymimetype=text/plain      ; Allow overriding of mime type in MWI NOTIFY
48 ;checkmwi=10                    ; Default time between mailbox checks for peers
49 ;videosupport=yes               ; Turn on support for SIP video
50
51 ;disallow=all                   ; First disallow all codecs
52 ;allow=ulaw                     ; Allow codecs in order of preference
53 ;allow=ilbc                     ; Note: codec order is respected only in [general]
54 ;musicclass=default             ; Sets the default music on hold class for all SIP calls
55                                 ; This may also be set for individual users/peers
56 ;language=en                    ; Default language setting for all users/peers
57                                 ; This may also be set for individual users/peers
58 ;relaxdtmf=yes                  ; Relax dtmf handling
59 ;rtptimeout=60                  ; Terminate call if 60 seconds of no RTP activity
60                                 ; when we're not on hold
61 ;rtpholdtimeout=300             ; Terminate call if 300 seconds of no RTP activity
62                                 ; when we're on hold (must be > rtptimeout)
63 ;trustrpid = no                 ; If Remote-Party-ID should be trusted
64 ;progressinband=no              ; If we should generate in-band ringing always
65                                 ; use 'never' to never use in-band signalling, even in cases
66                                 ; where some buggy devices might not render it
67 ;useragent=Asterisk PBX         ; Allows you to change the user agent string
68 ;nat=no                         ; NAT settings 
69                                 ; yes = Always ignore info and assume NAT
70                                 ; no = Use NAT mode only according to RFC3581 
71                                 ; never = Never attempt NAT mode or RFC3581 support
72                                 ; route = Assume NAT, don't send rport 
73                                 ; (work around more UNIDEN bugs)
74 ;promiscredir = no              ; If yes, allows 302 or REDIR to non-local SIP address
75                                 ; Note that promiscredir when redirects are made to the
76                                 ; local system will cause loops since SIP is incapable
77 ;usereqphone = no               ; If yes, ";user=phone" is added to uri that contains
78                                 ; a valid phone number
79                                 ; of performing a "hairpin" call.
80 ;dtmfmode = rfc2833             ; Set default dtmfmode for sending DTMF. Default: rfc2833
81                                 ; Other options: 
82                                 ; info : SIP INFO messages
83                                 ; inband : Inband audio
84
85 ;compactheaders = yes           ; send compact sip headers.
86
87 ;
88 ; If regcontext is specified, Asterisk will dynamically 
89 ; create and destroy a NoOp priority 1 extension for a given
90 ; peer who registers or unregisters with us.  The actual extension
91 ; is the 'regexten' parameter of the registering peer or its
92 ; name if 'regexten' is not provided.  More than one regexten may be supplied
93 ; if they are separated by '&'.  Patterns may be used in regexten.
94 ;
95 ;regcontext=sipregistrations
96 ;
97 ; Asterisk can register as a SIP user agent to a SIP proxy (provider)
98 ; Format for the register statement is:
99 ;       register => user[:secret[:authuser]]@host[:port][/extension]
100 ;
101 ; If no extension is given, the 's' extension is used. The extension
102 ; needs to be defined in extensions.conf to be able to accept calls
103 ; from this SIP proxy (provider)
104 ;
105 ; host is either a host name defined in DNS or the name of a 
106 ; section defined below.
107 ;
108 ; Examples:
109 ;
110 ;register => 1234:password@mysipprovider.com    
111 ;
112 ;     This will pass incoming calls to the 's' extension
113 ;
114 ;
115 ;register => 2345:password@sip_proxy/1234
116 ;
117 ;    Register 2345 at sip provider 'sip_proxy'.  Calls from this provider connect to local 
118 ;    extension 1234 in extensions.conf default context, unless you define 
119 ;    unless you configure a [sip_proxy] section below, and configure a context.
120 ;        Tip 1: Avoid assigning hostname to a sip.conf section like [provider.com]
121 ;        Tip 2: Use separate type=peer and type=user sections for SIP providers
122 ;                      (instead of type=friend) if you have calls in both directions
123   
124
125 ;externip = 200.201.202.203     ; Address that we're going to put in outbound SIP messages
126                                 ; if we're behind a NAT
127
128                                 ; The externip and localnet is used
129                                 ; when registering and communicating with other proxies
130                                 ; that we're registered with
131                                 ; You may add multiple local networks.  A reasonable set of defaults
132                                 ; are:
133 ;localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks
134 ;localnet=10.0.0.0/255.0.0.0    ; Also RFC1918
135 ;localnet=172.16.0.0/12         ; Another RFC1918 with CIDR notation
136 ;localnet=169.254.0.0/255.255.0.0 ;Zero conf local network
137
138 ;-----------------------------------------------------------------------------------
139 ; Users and peers have different settings available. Friends have all settings,
140 ; since a friend is both a peer and a user
141 ;
142 ; User config options:        Peer configuration:
143 ; --------------------        -------------------
144 ; context                     context
145 ; permit                      permit
146 ; deny                        deny
147 ; auth                        auth
148 ; secret                      secret
149 ; md5secret                   md5secret
150 ; dtmfmode                    dtmfmode
151 ; canreinvite                 canreinvite
152 ; nat                         nat
153 ; callgroup                   callgroup
154 ; pickupgroup                 pickupgroup
155 ; language                    language
156 ; allow                       allow
157 ; disallow                    disallow
158 ; insecure                    insecure
159 ; trustrpid                   trustrpid
160 ; progressinband              progressinband
161 ; promiscredir                promiscredir
162 ; useclientcode               useclientcode
163 ; setvar
164 ; callerid
165 ; accountcode
166 ; amaflags
167 ; incominglimit
168 ; restrictcid
169 ;                             mailbox
170 ;                             username
171 ;                             template
172 ;                             fromdomain
173 ;                             regexten
174 ;                             fromuser
175 ;                             host
176 ;                             mask
177 ;                             port
178 ;                             qualify
179 ;                             defaultip
180 ;                             rtptimeout
181 ;                             rtpholdtimeout
182
183 ;[sip_proxy]
184 ; For incoming calls only. Example: FWD (Free World Dialup)
185 ;type=user
186 ;context=from-fwd
187
188 ;[sip_proxy-out]
189 ;type=peer                      ; we only want to call out, not be called
190 ;secret=guessit
191 ;username=yourusername          ; Authentication user for outbound proxies
192 ;fromuser=yourusername          ; Many SIP providers require this!
193 ;host=box.provider.com
194 ;usereqphone=yes                ; This provider requires ";user=phone" on URI
195
196 ;[grandstream1]
197 ;type=friend                    ; either "friend" (peer+user), "peer" or "user"
198 ;context=from-sip
199 ;fromuser=grandstream1          ; overrides the callerid, e.g. required by FWD
200 ;callerid=John Doe <1234>
201 ;host=192.168.0.23              ; we have a static but private IP address
202 ;nat=no                         ; there is not NAT between phone and Asterisk
203 ;canreinvite=yes                ; allow RTP voice traffic to bypass Asterisk
204 ;dtmfmode=info                  ; either RFC2833 or INFO for the BudgeTone
205 ;incominglimit=1                ; permit only 1 outgoing call at a time
206                                 ; from the phone to asterisk
207 ;mailbox=1234@default  ; mailbox 1234 in voicemail context "default"
208 ;disallow=all                   ; need to disallow=all before we can use allow=
209 ;allow=ulaw                     ; Note: In user sections the order of codecs
210                                 ; listed with allow= does NOT matter!
211 ;allow=alaw
212 ;allow=g723.1                   ; Asterisk only supports g723.1 pass-thru!
213 ;allow=g729                     ; Pass-thru only unless g729 license obtained
214
215
216 ;[xlite1]
217 ;Turn off silence suppression in X-Lite ("Transmit Silence"=YES)!
218 ;Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
219 ;type=friend
220 ;regexten=1234                 ; When they register, create extension 1234
221 ;username=xlite1
222 ;callerid="Jane Smith" <5678>
223 ;host=dynamic
224 ;nat=yes                       ; X-Lite is behind a NAT router
225 ;canreinvite=no                ; Typically set to NO if behind NAT
226 ;disallow=all
227 ;allow=gsm                     ; GSM consumes far less bandwidth than ulaw
228 ;allow=ulaw
229 ;allow=alaw
230
231
232 ;[snom]
233 ;type=friend                    ; Friends place calls and receive calls
234 ;context=from-sip               ; Context for incoming calls from this user
235 ;secret=blah
236 ;language=de                    ; Use German prompts for this user 
237 ;host=dynamic                   ; This peer register with us
238 ;dtmfmode=inband                ; Choices are inband, rfc2833, or info
239 ;defaultip=192.168.0.59         ; IP used until peer registers
240 ;username=snom                  ; Username to use in INVITE until peer registers
241 ;mailbox=1234,2345              ; Mailboxes for message waiting indicator
242 ;restrictcid=yes                ; To have the callerid restriced -> sent as ANI
243 ;disallow=all
244 ;allow=ulaw                     ; dtmfmode=inband only works with ulaw or alaw!
245 ;mailbox=1234@context,2345      ; Mailbox(-es) for message waiting indicator
246
247
248 ;[pingtel]
249 ;type=friend
250 ;username=pingtel
251 ;secret=blah
252 ;host=dynamic
253 ;insecure=yes                   ; To match a peer based by IP address only and not peer
254 ;insecure=very                  ; To allow registered hosts to call without re-authenticating
255 ;qualify=1000                   ; Consider it down if it's 1 second to reply
256                                 ; Helps with NAT session
257                                 ; qualify=yes uses default value
258 ;callgroup=1,3-4                ; We are in caller groups 1,3,4
259 ;pickupgroup=1,3-5              ; We can do call pick-p for call group 1,3,4,5
260 ;defaultip=192.168.0.60         ; IP address to use if peer has not registred
261
262 ;[cisco1]
263 ;type=friend
264 ;username=cisco1
265 ;secret=blah
266 ;qualify=200                    ; Qualify peer is no more than 200ms away
267 ;nat=yes                        ; This phone may be natted
268                                 ; Send SIP and RTP to  IP address that packet is 
269                                 ; received from instead of trusting SIP headers 
270 ;host=dynamic                   ; This device registers with us
271 ;canreinvite=no                 ; Asterisk by default tries to redirect the
272                                 ; RTP media stream (audio) to go directly from
273                                 ; the caller to the callee.  Some devices do not
274                                 ; support this (especially if one of them is 
275                                 ; behind a NAT).
276 ;defaultip=192.168.0.4
277
278 ;[cisco2]
279 ;type=friend
280 ;username=cisco2
281 ;fromuser=markster              ; Specify user to put in "from" instead of callerid
282 ;fromdomain=yourdomain.com      ; Specify domain to put in "from" instead of callerid
283                                 ; fromuser and fromdomain are used when Asterisk
284                                 ; places calls to this account.  It is not used for
285                                 ; calls from this account.
286 ;secret=blah
287 ;host=dynamic
288 ;defaultip=192.168.0.4
289 ;amaflags=default               ; Choices are default, omit, billing, documentation
290 ;accountcode=markster           ; Users may be associated with an accountcode to ease billing