sip.conf.sample 12 KB

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