pjsip.conf 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916
  1. ; PJSIP Configuration Samples and Quick Reference
  2. ;
  3. ; This file has several very basic configuration examples, to serve as a quick
  4. ; reference to jog your memory when you need to write up a new configuration.
  5. ; It is not intended to teach PJSIP configuration or serve as an exhaustive
  6. ; reference of options and potential scenarios.
  7. ;
  8. ; This file has two main sections.
  9. ; First, manually written examples to serve as a handy reference.
  10. ; Second, a list of all possible PJSIP config options by section. This is
  11. ; pulled from the XML config help. It only shows the synopsis for every item.
  12. ; If you want to see more detail please check the documentation sources
  13. ; mentioned at the top of this file.
  14. ; Documentation
  15. ;
  16. ; The official documentation is at http://wiki.asterisk.org
  17. ; You can read the XML configuration help via Asterisk command line with
  18. ; "config show help res_pjsip", then you can drill down through the various
  19. ; sections and their options.
  20. ;
  21. ;========!!!!!!!!!!!!!!!!!!! SECURITY NOTICE !!!!!!!!!!!!!!!!!!!!===========
  22. ;
  23. ; At a minimum please read the file "README-SERIOUSLY.bestpractices.txt",
  24. ; located in the Asterisk source directory before starting Asterisk.
  25. ; Otherwise you risk allowing the security of the Asterisk system to be
  26. ; compromised. Beyond that please visit and read the security information on
  27. ; the wiki at: https://wiki.asterisk.org/wiki/x/EwFB
  28. ;
  29. ; A few basics to pay attention to:
  30. ;
  31. ; Anonymous Calls
  32. ;
  33. ; By default anonymous inbound calls via PJSIP are not allowed. If you want to
  34. ; route anonymous calls you'll need to define an endpoint named "anonymous".
  35. ; res_pjsip_endpoint_identifier_anonymous.so handles that functionality so it
  36. ; must be loaded. It is not recommended to accept anonymous calls.
  37. ;
  38. ; Access Control Lists
  39. ;
  40. ; See the example ACL configuration in this file. Read the configuration help
  41. ; for the section and all of its options. Look over the samples in acl.conf
  42. ; and documentation at https://wiki.asterisk.org/wiki/x/uA80AQ
  43. ; If possible, restrict access to only networks and addresses you trust.
  44. ;
  45. ; Dialplan Contexts
  46. ;
  47. ; When defining configuration (such as an endpoint) that links into
  48. ; dialplan configuration, be aware of what that dialplan does. It's easy to
  49. ; accidentally provide access to internal or outbound dialing extensions which
  50. ; could cost you severely. The "context=" line in endpoint configuration
  51. ; determines which dialplan context inbound calls will enter into.
  52. ;
  53. ;=============================================================================
  54. ; Overview of Configuration Section Types Used in the Examples
  55. ;
  56. ; * Transport "transport"
  57. ; * Configures res_pjsip transport layer interaction.
  58. ; * Endpoint "endpoint"
  59. ; * Configures core SIP functionality related to SIP endpoints.
  60. ; * Authentication "auth"
  61. ; * Stores inbound or outbound authentication credentials for use by trunks,
  62. ; endpoints, registrations.
  63. ; * Address of Record "aor"
  64. ; * Stores contact information for use by endpoints.
  65. ; * Endpoint Identification "identify"
  66. ; * Maps a host directly to an endpoint
  67. ; * Access Control List "acl"
  68. ; * Defines a permission list or references one stored in acl.conf
  69. ; * Registration "registration"
  70. ; * Contains information about an outbound SIP registration
  71. ; * Phone Provisioning "phoneprov"
  72. ; * Contains information needed by res_phoneprov for autoprovisioning
  73. ; The following sections show example configurations for various scenarios.
  74. ; Most require a couple or more configuration types configured in concert.
  75. ;=============================================================================
  76. ; Naming of Configuration Sections
  77. ;
  78. ; Configuration section names are denoted with enclosing brackets,
  79. ; e.g. [6001]
  80. ; In most cases, you can name a section whatever makes sense to you. For example
  81. ; you might name a transport [transport-udp-nat] to help you remember how that
  82. ; section is being used. However, in some cases, ("endpoint" and "aor" types)
  83. ; the section name has a relationship to its function.
  84. ;
  85. ; Depending on the modules loaded, Asterisk can match SIP requests to an
  86. ; endpoint or aor in a few ways:
  87. ;
  88. ; 1) Match a section name for endpoint type sections to the username in the
  89. ; "From" header of inbound SIP requests.
  90. ; 2) Match a section name for aor type sections to the username in the "To"
  91. ; header of inbound SIP REGISTER requests.
  92. ; 3) With an identify type section configured, match an inbound SIP request of
  93. ; any type to an endpoint or aor based on the IP source address of the
  94. ; request.
  95. ;
  96. ; Note that sections can have the same name as long as their "type" options are
  97. ; set to different values. In most cases it makes sense to have associated
  98. ; configuration sections use the same name, as you'll see in the examples within
  99. ; this file.
  100. ;===============EXAMPLE TRANSPORTS============================================
  101. ;
  102. ; A few examples for potential transport options.
  103. ;
  104. ; For the NAT transport example, be aware that the options starting with
  105. ; the prefix "external_" will only apply to communication with addresses
  106. ; outside the range set with "local_net=".
  107. ;
  108. ; IPv6: For endpoints using IPv6, remember to set "rtp_ipv6=yes" so that the RTP
  109. ; engine will also be able to bind to an IPv6 address.
  110. ;
  111. ; You can have more than one of any type of transport, as long as it doesn't
  112. ; use the same resources (bind address, port, etc) as the others.
  113. ; Basic UDP transport
  114. ;
  115. ;[transport-udp]
  116. ;type=transport
  117. ;protocol=udp ;udp,tcp,tls,ws,wss
  118. ;bind=0.0.0.0
  119. ; UDP transport behind NAT
  120. ;
  121. ;[transport-udp-nat]
  122. ;type=transport
  123. ;protocol=udp
  124. ;bind=0.0.0.0
  125. ;local_net=192.0.2.0/24
  126. ;external_media_address=203.0.113.1
  127. ;external_signaling_address=203.0.113.1
  128. ; Basic IPv6 UDP transport
  129. ;
  130. ;[transport-udp-ipv6]
  131. ;type=transport
  132. ;protocol=udp
  133. ;bind=::
  134. ; Example IPv4 TLS transport
  135. ;
  136. ;[transport-tls]
  137. ;type=transport
  138. ;protocol=tls
  139. ;bind=0.0.0.0
  140. ;cert_file=/path/mycert.crt
  141. ;priv_key_file=/path/mykey.key
  142. ;cipher=ADH-AES256-SHA,ADH-AES128-SHA
  143. ;method=tlsv1
  144. ;===============OUTBOUND REGISTRATION WITH OUTBOUND AUTHENTICATION============
  145. ;
  146. ; This is a simple registration that works with some SIP trunking providers.
  147. ; You'll need to set up the auth example "mytrunk_auth" below to enable outbound
  148. ; authentication. Note that we "outbound_auth=" use for outbound authentication
  149. ; instead of "auth=", which is for inbound authentication.
  150. ;
  151. ; If you are registering to a server from behind NAT, be sure you assign a transport
  152. ; that is appropriately configured with NAT related settings. See the NAT transport example.
  153. ;
  154. ; "contact_user=" sets the SIP contact header's user portion of the SIP URI
  155. ; this will affect the extension reached in dialplan when the far end calls you at this
  156. ; registration. The default is 's'.
  157. ;[mytrunk]
  158. ;type=registration
  159. ;transport=transport-udp
  160. ;outbound_auth=mytrunk_auth
  161. ;server_uri=sip:sip.example.com
  162. ;client_uri=sip:1234567890@sip.example.com
  163. ;contact_user=1234567890
  164. ;retry_interval=60
  165. ;forbidden_retry_interval=600
  166. ;expiration=3600
  167. ;[mytrunk_auth]
  168. ;type=auth
  169. ;auth_type=userpass
  170. ;password=1234567890
  171. ;username=1234567890
  172. ;realm=sip.example.com
  173. ;===============ENDPOINT CONFIGURED AS A TRUNK, OUTBOUND AUTHENTICATION=======
  174. ;
  175. ; This is one way to configure an endpoint as a trunk. It is set up with
  176. ; "outbound_auth=" to enable authentication when dialing out through this
  177. ; endpoint. There is no inbound authentication set up since a provider will
  178. ; not normally authenticate when calling you.
  179. ;
  180. ; The identify configuration enables IP address matching against this endpoint.
  181. ; For calls from a trunking provider, the From user may be different every time,
  182. ; so we want to match against IP address instead of From user.
  183. ;
  184. ; If you want the provider of your trunk to know where to send your calls
  185. ; you'll need to use an outbound registration as in the example above this
  186. ; section.
  187. ;
  188. ; NAT
  189. ;
  190. ; At a basic level configure the endpoint with a transport that is set up
  191. ; with the appropriate NAT settings. There may be some additional settings you
  192. ; need here based on your NAT/Firewall scenario. Look to the CLI config help
  193. ; "config show help res_pjsip endpoint" or on the wiki for other NAT related
  194. ; options and configuration. We've included a few below.
  195. ;
  196. ; AOR
  197. ;
  198. ; Endpoints use one or more AOR sections to store their contact details.
  199. ; You can define multiple contact addresses in SIP URI format in multiple
  200. ; "contact=" entries.
  201. ;
  202. ;[mytrunk]
  203. ;type=endpoint
  204. ;transport=transport-udp
  205. ;context=from-external
  206. ;disallow=all
  207. ;allow=ulaw
  208. ;outbound_auth=mytrunk_auth
  209. ;aors=mytrunk
  210. ; ;A few NAT relevant options that may come in handy.
  211. ;force_rport=yes ;It's a good idea to read the configuration help for each
  212. ;direct_media=no ;of these options.
  213. ;ice_support=yes
  214. ;[mytrunk]
  215. ;type=aor
  216. ;contact=sip:198.51.100.1:5060
  217. ;contact=sip:198.51.100.2:5060
  218. ;[mytrunk]
  219. ;type=identify
  220. ;endpoint=mytrunk
  221. ;match=198.51.100.1
  222. ;match=198.51.100.2
  223. ;=============ENDPOINT CONFIGURED AS A TRUNK, INBOUND AUTH AND REGISTRATION===
  224. ;
  225. ; Here we are allowing a remote device to register to Asterisk and requiring
  226. ; that they authenticate for registration and calls.
  227. ; You'll note that this configuration is essentially the same as configuring
  228. ; an endpoint for use with a SIP phone.
  229. ;[7000]
  230. ;type=endpoint
  231. ;context=from-external
  232. ;disallow=all
  233. ;allow=ulaw
  234. ;transport=transport-udp
  235. ;auth=7000
  236. ;aors=7000
  237. ;[7000]
  238. ;type=auth
  239. ;auth_type=userpass
  240. ;password=7000
  241. ;username=7000
  242. ;[7000]
  243. ;type=aor
  244. ;max_contacts=1
  245. ;===============ENDPOINT CONFIGURED FOR USE WITH A SIP PHONE==================
  246. ;
  247. ; This example includes the endpoint, auth and aor configurations. It
  248. ; requires inbound authentication and allows registration, as well as references
  249. ; a transport that you'll need to uncomment from the previous examples.
  250. ;
  251. ; Uncomment one of the transport lines to choose which transport you want. If
  252. ; not specified then the default transport chosen is the first defined transport
  253. ; in the configuration file.
  254. ;
  255. ; Modify the "max_contacts=" line to change how many unique registrations to allow.
  256. ;
  257. ; Use the "contact=" line instead of max_contacts= if you want to statically
  258. ; define the location of the device.
  259. ;
  260. ; If using the TLS enabled transport, you may want the "media_encryption=sdes"
  261. ; option to additionally enable SRTP, though they are not mutually inclusive.
  262. ;
  263. ; Use the "rtp_ipv6=yes" option if you want to utilize RTP over an ipv6 transport.
  264. ;
  265. ; If this endpoint were remote, and it was using a transport configured for NAT
  266. ; then you likely want to use "direct_media=no" to prevent audio issues.
  267. ;[6001]
  268. ;type=endpoint
  269. ;transport=transport-udp
  270. ;context=from-internal
  271. ;disallow=all
  272. ;allow=ulaw
  273. ;allow=gsm
  274. ;auth=6001
  275. ;aors=6001
  276. ;
  277. ; A few more transports to pick from, and some related options below them.
  278. ;
  279. ;transport=transport-tls
  280. ;media_encryption=sdes
  281. ;transport=transport-udp-ipv6
  282. ;rtp_ipv6=yes
  283. ;transport=transport-udp-nat
  284. ;direct_media=no
  285. ;
  286. ; MWI related options
  287. ;aggregate_mwi=yes
  288. ;mailboxes=6001@default,7001@default
  289. ;mwi_from_user=6001
  290. ;
  291. ; Extension and Device state options
  292. ;
  293. ;device_state_busy_at=1
  294. ;allow_subscribe=yes
  295. ;sub_min_expiry=30
  296. ;[6001]
  297. ;type=auth
  298. ;auth_type=userpass
  299. ;password=6001
  300. ;username=6001
  301. ;[6001]
  302. ;type=aor
  303. ;max_contacts=1
  304. ;contact=sip:6001@192.0.2.1:5060
  305. ;===============ENDPOINT BEHIND NAT OR FIREWALL===============================
  306. ;
  307. ; This example assumes your transport is configured with a public IP and the
  308. ; endpoint itself is behind NAT and maybe a firewall, rather than having
  309. ; Asterisk behind NAT. For the sake of simplicity, we'll assume a typical
  310. ; VOIP phone. The most important settings to configure are:
  311. ;
  312. ; * direct_media, to ensure Asterisk stays in the media path
  313. ; * rtp_symmetric and force_rport options to help the far-end NAT/firewall
  314. ;
  315. ; Depending on the settings of your remote SIP device or NAT/firewall device
  316. ; you may have to experiment with a combination of these settings.
  317. ;
  318. ; If both Asterisk and the remote phones are a behind NAT/firewall then you'll
  319. ; have to make sure to use a transport with appropriate settings (as in the
  320. ; transport-udp-nat example).
  321. ;
  322. ;[6002]
  323. ;type=endpoint
  324. ;transport=transport-udp
  325. ;context=from-internal
  326. ;disallow=all
  327. ;allow=ulaw
  328. ;auth=6002
  329. ;aors=6002
  330. ;direct_media=no
  331. ;rtp_symmetric=yes
  332. ;force_rport=yes
  333. ;rewrite_contact=yes ; necessary if endpoint does not know/register public ip:port
  334. ;ice_support=yes ;This is specific to clients that support NAT traversal
  335. ;for media via ICE,STUN,TURN. See the wiki at:
  336. ;https://wiki.asterisk.org/wiki/x/D4FHAQ
  337. ;for a deeper explanation of this topic.
  338. ;[6002]
  339. ;type=auth
  340. ;auth_type=userpass
  341. ;password=6002
  342. ;username=6002
  343. ;[6002]
  344. ;type=aor
  345. ;max_contacts=2
  346. ;============EXAMPLE ACL CONFIGURATION==========================================
  347. ;
  348. ; The ACL or Access Control List section defines a set of permissions to permit
  349. ; or deny access to various address or addresses. Alternatively it references an
  350. ; ACL configuration already set in acl.conf.
  351. ;
  352. ; The ACL configuration is independent of individual endpoint configuration and
  353. ; operates on all inbound SIP communication using res_pjsip.
  354. ; Reference an ACL defined in acl.conf.
  355. ;
  356. ;[acl]
  357. ;type=acl
  358. ;acl=example_named_acl1
  359. ; Reference a contactacl specifically.
  360. ;
  361. ;[acl]
  362. ;type=acl
  363. ;contact_acl=example_contact_acl1
  364. ; Define your own ACL here in pjsip.conf and
  365. ; permit or deny by IP address or range.
  366. ;
  367. ;[acl]
  368. ;type=acl
  369. ;deny=0.0.0.0/0.0.0.0
  370. ;permit=209.16.236.0/24
  371. ;deny=209.16.236.1
  372. ; Restrict based on Contact Headers rather than IP.
  373. ; Define options multiple times for various addresses or use a comma-delimited string.
  374. ;
  375. ;[acl]
  376. ;type=acl
  377. ;contact_deny=0.0.0.0/0.0.0.0
  378. ;contact_permit=209.16.236.0/24
  379. ;contact_permit=209.16.236.1
  380. ;contact_permit=209.16.236.2,209.16.236.3
  381. ; Restrict based on Contact Headers rather than IP and use
  382. ; advanced syntax. Note the bang symbol used for "NOT", so we can deny
  383. ; 209.16.236.12/32 within the permit= statement.
  384. ;
  385. ;[acl]
  386. ;type=acl
  387. ;contact_deny=0.0.0.0/0.0.0.0
  388. ;contact_permit=209.16.236.0
  389. ;permit=209.16.236.0/24, !209.16.236.12/32
  390. ;============EXAMPLE RLS CONFIGURATION==========================================
  391. ;
  392. ;Asterisk provides support for RFC 4662 Resource List Subscriptions. This allows
  393. ;for an endpoint to, through a single subscription, subscribe to the states of
  394. ;multiple resources. Resource lists are configured in pjsip.conf using the
  395. ;resource_list configuration object. Below is an example of a resource list that
  396. ;allows an endpoint to subscribe to the presence of alice, bob, and carol.
  397. ;[my_list]
  398. ;type=resource_list
  399. ;list_item=alice
  400. ;list_item=bob
  401. ;list_item=carol
  402. ;event=presence
  403. ;The "event" option in the resource list corresponds to the SIP event-package
  404. ;that the subscribed resources belong to. A resource list can only provide states
  405. ;for resources that belong to the same event-package. This means that you cannot
  406. ;create a list that is a combination of presence and message-summary resources,
  407. ;for instance. Any event-package that Asterisk supports can be used in a resource
  408. ;list (presence, dialog, and message-summary). Whenever support for a new event-
  409. ;package is added to Asterisk, support for that event-package in resource lists
  410. ;will automatically be supported.
  411. ;The "list_item" options indicate the names of resources to subscribe to. The
  412. ;way these are interpreted is event-package specific. For instance, with presence
  413. ;list_items, hints in the dialplan are looked up. With message-summary list_items,
  414. ;mailboxes are looked up using your installed voicemail provider (app_voicemail
  415. ;by default). Note that in the above example, the list_item options were given
  416. ;one per line. However, it is also permissible to provide multiple list_item
  417. ;options on a single line (e.g. list_item = alice,bob,carol).
  418. ;In addition to the options presented in the above configuration, there are two
  419. ;more configuration options that can be set.
  420. ; * full_state: dictates whether Asterisk should always send the states of
  421. ; all resources in the list at once. Defaults to "no". You should only set
  422. ; this to "yes" if you are interoperating with an endpoint that does not
  423. ; behave correctly when partial state notifications are sent to it.
  424. ; * notification_batch_interval: By default, Asterisk will send a NOTIFY request
  425. ; immediately when a resource changes state. This option causes Asterisk to
  426. ; start batching resource state changes for the specified number of milliseconds
  427. ; after a resource changes states. This way, if multiple resources change state
  428. ; within a brief interval, Asterisk can send a single NOTIFY request with all
  429. ; of the state changes reflected in it.
  430. ;There is a limitation to the size of resource lists in Asterisk. If a constructed
  431. ;notification from Asterisk will exceed 64000 bytes, then the message is deemed
  432. ;too large to send. If you find that you are seeing error messages about SIP
  433. ;NOTIFY requests being too large to send, consider breaking your lists into
  434. ;sub-lists.
  435. ;============EXAMPLE PHONEPROV CONFIGURATION================================
  436. ; Before configuring provisioning here, see the documentation for res_phoneprov
  437. ; and configure phoneprov.conf appropriately.
  438. ; For each user to be autoprovisioned, a [phoneprov] configuration section
  439. ; must be created. At a minimum, the 'type', 'PROFILE' and 'MAC' variables must
  440. ; be set. All other variables are optional.
  441. ; Example:
  442. ;[1000]
  443. ;type=phoneprov ; must be specified as 'phoneprov'
  444. ;endpoint=1000 ; Required only if automatic setting of
  445. ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  446. ; are needed.
  447. ;PROFILE=digium ; required
  448. ;MAC=deadbeef4dad ; required
  449. ;SERVER=myserver.example.com ; A standard variable
  450. ;TIMEZONE=America/Denver ; A standard variable
  451. ;MYVAR=somevalue ; A user confdigured variable
  452. ; If the phoneprov sections have common variables, it is best to create a
  453. ; phoneprov template. The example below will produce the same configuration
  454. ; as the one specified above except that MYVAR will be overridden for
  455. ; the specific user.
  456. ; Example:
  457. ;[phoneprov_defaults](!)
  458. ;type=phoneprov ; must be specified as 'phoneprov'
  459. ;PROFILE=digium ; required
  460. ;SERVER=myserver.example.com ; A standard variable
  461. ;TIMEZONE=America/Denver ; A standard variable
  462. ;MYVAR=somevalue ; A user configured variable
  463. ;[1000](phoneprov_defaults)
  464. ;endpoint=1000 ; Required only if automatic setting of
  465. ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  466. ; are needed.
  467. ;MAC=deadbeef4dad ; required
  468. ;MYVAR=someOTHERvalue ; A user confdigured variable
  469. ; To have USERNAME and SECRET automatically set, the endpoint
  470. ; specified here must in turn have an outbound_auth section defined.
  471. ; Fuller example:
  472. ;[1000]
  473. ;type=endpoint
  474. ;outbound_auth=1000-auth
  475. ;callerid=My Name <8005551212>
  476. ;transport=transport-udp-nat
  477. ;[1000-auth]
  478. ;type=auth
  479. ;auth_type=userpass
  480. ;username=myname
  481. ;password=mysecret
  482. ;[phoneprov_defaults](!)
  483. ;type=phoneprov ; must be specified as 'phoneprov'
  484. ;PROFILE=someprofile ; required
  485. ;SERVER=myserver.example.com ; A standard variable
  486. ;TIMEZONE=America/Denver ; A standard variable
  487. ;MYVAR=somevalue ; A user configured variable
  488. ;[1000](phoneprov_defaults)
  489. ;endpoint=1000 ; Required only if automatic setting of
  490. ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  491. ; are needed.
  492. ;MAC=deadbeef4dad ; required
  493. ;MYVAR=someUSERvalue ; A user confdigured variable
  494. ;LABEL=1000 ; A standard variable
  495. ; The previous sections would produce a template substitution map as follows:
  496. ;MAC=deadbeef4dad ;added by pp1000
  497. ;USERNAME=myname ;automatically added by 1000-auth username
  498. ;SECRET=mysecret ;automatically added by 1000-auth password
  499. ;PROFILE=someprofile ;added by defaults
  500. ;SERVER=myserver.example.com ;added by defaults
  501. ;SERVER_PORT=5060 ;added by defaults
  502. ;MYVAR=someUSERvalue ;added by defaults but overdidden by user
  503. ;CALLERID=8005551212 ;automatically added by 1000 callerid
  504. ;DISPLAY_NAME=My Name ;automatically added by 1000 callerid
  505. ;TIMEZONE=America/Denver ;added by defaults
  506. ;TZOFFSET=252100 ;automatically calculated by res_phoneprov
  507. ;DST_ENABLE=1 ;automatically calculated by res_phoneprov
  508. ;DST_START_MONTH=3 ;automatically calculated by res_phoneprov
  509. ;DST_START_MDAY=9 ;automatically calculated by res_phoneprov
  510. ;DST_START_HOUR=3 ;automatically calculated by res_phoneprov
  511. ;DST_END_MONTH=11 ;automatically calculated by res_phoneprov
  512. ;DST_END_MDAY=2 ;automatically calculated by res_phoneprov
  513. ;DST_END_HOUR=1 ;automatically calculated by res_phoneprov
  514. ;ENDPOINT_ID=1000 ;automatically added by this module
  515. ;AUTH_ID=1000-auth ;automatically added by this module
  516. ;TRANSPORT_ID=transport-udp-nat ;automatically added by this module
  517. ;LABEL=1000 ;added by user
  518. ; MODULE PROVIDING BELOW SECTION(S): res_pjsip
  519. ;==========================ENDPOINT SECTION OPTIONS=========================
  520. ;[endpoint]
  521. ; SYNOPSIS: Endpoint
  522. ;100rel=yes ; Allow support for RFC3262 provisional ACK tags (default:
  523. ; "yes")
  524. ;aggregate_mwi=yes ; (default: "yes")
  525. ;allow= ; Media Codec s to allow (default: "")
  526. ;aors= ; AoR s to be used with the endpoint (default: "")
  527. ;auth= ; Authentication Object s associated with the endpoint (default: "")
  528. ;callerid= ; CallerID information for the endpoint (default: "")
  529. ;callerid_privacy=allowed_not_screened ; Default privacy level (default: "allowed_not_screened")
  530. ;callerid_tag= ; Internal id_tag for the endpoint (default: "")
  531. ;context=default ; Dialplan context for inbound sessions (default:
  532. ; "default")
  533. ;direct_media_glare_mitigation=none ; Mitigation of direct media re INVITE
  534. ; glare (default: "none")
  535. ;direct_media_method=invite ; Direct Media method type (default: "invite")
  536. ;connected_line_method=invite ; Connected line method type (default:
  537. ; "invite")
  538. ;direct_media=yes ; Determines whether media may flow directly between
  539. ; endpoints (default: "yes")
  540. ;disable_direct_media_on_nat=no ; Disable direct media session refreshes when
  541. ; NAT obstructs the media session (default:
  542. ; "no")
  543. ;disallow= ; Media Codec s to disallow (default: "")
  544. ;dtmf_mode=rfc4733 ; DTMF mode (default: "rfc4733")
  545. ;media_address= ; IP address used in SDP for media handling (default: "")
  546. ;force_rport=yes ; Force use of return port (default: "yes")
  547. ;ice_support=no ; Enable the ICE mechanism to help traverse NAT (default: "no")
  548. ;identify_by=username ; Way s for Endpoint to be identified (default:
  549. ; "username")
  550. ;redirect_method=user ; How redirects received from an endpoint are handled
  551. ; (default: "user")
  552. ;mailboxes= ; Mailbox es to be associated with (default: "")
  553. ;moh_suggest=default ; Default Music On Hold class (default: "default")
  554. ;outbound_auth= ; Authentication object used for outbound requests (default:
  555. ; "")
  556. ;outbound_proxy= ; Proxy through which to send requests a full SIP URI
  557. ; must be provided (default: "")
  558. ;rewrite_contact=no ; Allow Contact header to be rewritten with the source
  559. ; IP address port (default: "no")
  560. ;rtp_ipv6=no ; Allow use of IPv6 for RTP traffic (default: "no")
  561. ;rtp_symmetric=no ; Enforce that RTP must be symmetric (default: "no")
  562. ;send_diversion=yes ; Send the Diversion header conveying the diversion
  563. ; information to the called user agent (default: "yes")
  564. ;send_pai=no ; Send the P Asserted Identity header (default: "no")
  565. ;send_rpid=no ; Send the Remote Party ID header (default: "no")
  566. ;timers_min_se=90 ; Minimum session timers expiration period (default:
  567. ; "90")
  568. ;timers=yes ; Session timers for SIP packets (default: "yes")
  569. ;timers_sess_expires=1800 ; Maximum session timer expiration period
  570. ; (default: "1800")
  571. ;transport= ; Desired transport configuration (default: "")
  572. ;trust_id_inbound=no ; Accept identification information received from this
  573. ; endpoint (default: "no")
  574. ;trust_id_outbound=no ; Send private identification details to the endpoint
  575. ; (default: "no")
  576. ;type= ; Must be of type endpoint (default: "")
  577. ;use_ptime=no ; Use Endpoint s requested packetisation interval (default:
  578. ; "no")
  579. ;use_avpf=no ; Determines whether res_pjsip will use and enforce usage of
  580. ; AVPF for this endpoint (default: "no")
  581. ;media_encryption=no ; Determines whether res_pjsip will use and enforce
  582. ; usage of media encryption for this endpoint (default:
  583. ; "no")
  584. ;inband_progress=no ; Determines whether chan_pjsip will indicate ringing
  585. ; using inband progress (default: "no")
  586. ;call_group= ; The numeric pickup groups for a channel (default: "")
  587. ;pickup_group= ; The numeric pickup groups that a channel can pickup (default:
  588. ; "")
  589. ;named_call_group= ; The named pickup groups for a channel (default: "")
  590. ;named_pickup_group= ; The named pickup groups that a channel can pickup
  591. ; (default: "")
  592. ;device_state_busy_at=0 ; The number of in use channels which will cause busy
  593. ; to be returned as device state (default: "0")
  594. ;t38_udptl=no ; Whether T 38 UDPTL support is enabled or not (default: "no")
  595. ;t38_udptl_ec=none ; T 38 UDPTL error correction method (default: "none")
  596. ;t38_udptl_maxdatagram=0 ; T 38 UDPTL maximum datagram size (default:
  597. ; "0")
  598. ;fax_detect=no ; Whether CNG tone detection is enabled (default: "no")
  599. ;t38_udptl_nat=no ; Whether NAT support is enabled on UDPTL sessions
  600. ; (default: "no")
  601. ;t38_udptl_ipv6=no ; Whether IPv6 is used for UDPTL Sessions (default:
  602. ; "no")
  603. ;tone_zone= ; Set which country s indications to use for channels created
  604. ; for this endpoint (default: "")
  605. ;language= ; Set the default language to use for channels created for this
  606. ; endpoint (default: "")
  607. ;one_touch_recording=no ; Determines whether one touch recording is allowed for
  608. ; this endpoint (default: "no")
  609. ;record_on_feature=automixmon ; The feature to enact when one touch recording
  610. ; is turned on (default: "automixmon")
  611. ;record_off_feature=automixmon ; The feature to enact when one touch recording
  612. ; is turned off (default: "automixmon")
  613. ;rtp_engine=asterisk ; Name of the RTP engine to use for channels created
  614. ; for this endpoint (default: "asterisk")
  615. ;allow_transfer=yes ; Determines whether SIP REFER transfers are allowed
  616. ; for this endpoint (default: "yes")
  617. ;sdp_owner=- ; String placed as the username portion of an SDP origin o line
  618. ; (default: "-")
  619. ;sdp_session=Asterisk ; String used for the SDP session s line (default:
  620. ; "Asterisk")
  621. ;tos_audio=0 ; DSCP TOS bits for audio streams (default: "0")
  622. ;tos_video=0 ; DSCP TOS bits for video streams (default: "0")
  623. ;cos_audio=0 ; Priority for audio streams (default: "0")
  624. ;cos_video=0 ; Priority for video streams (default: "0")
  625. ;allow_subscribe=yes ; Determines if endpoint is allowed to initiate
  626. ; subscriptions with Asterisk (default: "yes")
  627. ;sub_min_expiry=0 ; The minimum allowed expiry time for subscriptions
  628. ; initiated by the endpoint (default: "0")
  629. ;from_user= ; Username to use in From header for requests to this endpoint
  630. ; (default: "")
  631. ;mwi_from_user= ; Username to use in From header for unsolicited MWI NOTIFYs to
  632. ; this endpoint (default: "")
  633. ;from_domain= ; Domain to user in From header for requests to this endpoint
  634. ; (default: "")
  635. ;dtls_verify=no ; Verify that the provided peer certificate is valid (default:
  636. ; "no")
  637. ;dtls_rekey=0 ; Interval at which to renegotiate the TLS session and rekey
  638. ; the SRTP session (default: "0")
  639. ;dtls_cert_file= ; Path to certificate file to present to peer (default:
  640. ; "")
  641. ;dtls_private_key= ; Path to private key for certificate file (default:
  642. ; "")
  643. ;dtls_cipher= ; Cipher to use for DTLS negotiation (default: "")
  644. ;dtls_ca_file= ; Path to certificate authority certificate (default: "")
  645. ;dtls_ca_path= ; Path to a directory containing certificate authority
  646. ; certificates (default: "")
  647. ;dtls_setup= ; Whether we are willing to accept connections connect to the
  648. ; other party or both (default: "")
  649. ;dtls_fingerprint= ; Hash to use for the fingerprint placed into SDP
  650. ; (default: "SHA-256")
  651. ;srtp_tag_32=no ; Determines whether 32 byte tags should be used instead of 80
  652. ; byte tags (default: "no")
  653. ;set_var= ; Variable set on a channel involving the endpoint. For multiple
  654. ; channel variables specify multiple 'set_var'(s)
  655. ;==========================AUTH SECTION OPTIONS=========================
  656. ;[auth]
  657. ; SYNOPSIS: Authentication type
  658. ;auth_type=userpass ; Authentication type (default: "userpass")
  659. ;nonce_lifetime=32 ; Lifetime of a nonce associated with this
  660. ; authentication config (default: "32")
  661. ;md5_cred= ; MD5 Hash used for authentication (default: "")
  662. ;password= ; PlainText password used for authentication (default: "")
  663. ;realm= ; SIP realm for endpoint (default: "")
  664. ;type= ; Must be auth (default: "")
  665. ;username= ; Username to use for account (default: "")
  666. ;==========================DOMAIN_ALIAS SECTION OPTIONS=========================
  667. ;[domain_alias]
  668. ; SYNOPSIS: Domain Alias
  669. ;type= ; Must be of type domain_alias (default: "")
  670. ;domain= ; Domain to be aliased (default: "")
  671. ;==========================TRANSPORT SECTION OPTIONS=========================
  672. ;[transport]
  673. ; SYNOPSIS: SIP Transport
  674. ;async_operations=1 ; Number of simultaneous Asynchronous Operations
  675. ; (default: "1")
  676. ;bind= ; IP Address and optional port to bind to for this transport (default:
  677. ; "")
  678. ;ca_list_file= ; File containing a list of certificates to read TLS ONLY
  679. ; (default: "")
  680. ;cert_file= ; Certificate file for endpoint TLS ONLY (default: "")
  681. ;cipher= ; Preferred cryptography cipher names TLS ONLY (default: "")
  682. ;domain= ; Domain the transport comes from (default: "")
  683. ;external_media_address= ; External IP address to use in RTP handling
  684. ; (default: "")
  685. ;external_signaling_address= ; External address for SIP signalling (default:
  686. ; "")
  687. ;external_signaling_port=0 ; External port for SIP signalling (default:
  688. ; "0")
  689. ;method= ; Method of SSL transport TLS ONLY (default: "")
  690. ;local_net= ; Network to consider local used for NAT purposes (default: "")
  691. ;password= ; Password required for transport (default: "")
  692. ;priv_key_file= ; Private key file TLS ONLY (default: "")
  693. ;protocol=udp ; Protocol to use for SIP traffic (default: "udp")
  694. ;require_client_cert= ; Require client certificate TLS ONLY (default: "")
  695. ;type= ; Must be of type transport (default: "")
  696. ;verify_client= ; Require verification of client certificate TLS ONLY (default:
  697. ; "")
  698. ;verify_server= ; Require verification of server certificate TLS ONLY (default:
  699. ; "")
  700. ;tos=0 ; Enable TOS for the signalling sent over this transport (default: "0")
  701. ;cos=0 ; Enable COS for the signalling sent over this transport (default: "0")
  702. ;websocket_write_timeout=100 ; Default write timeout to set on websocket
  703. ; transports. This value may need to be adjusted
  704. ; for connections where Asterisk must write a
  705. ; substantial amount of data and the receiving
  706. ; clients are slow to process the received
  707. ; information. Value is in milliseconds; default
  708. ; is 100 ms.
  709. ;==========================CONTACT SECTION OPTIONS=========================
  710. ;[contact]
  711. ; SYNOPSIS: A way of creating an aliased name to a SIP URI
  712. ;type= ; Must be of type contact (default: "")
  713. ;uri= ; SIP URI to contact peer (default: "")
  714. ;expiration_time= ; Time to keep alive a contact (default: "")
  715. ;qualify_frequency=0 ; Interval at which to qualify a contact (default: "0")
  716. ;outbound_proxy= ; Outbound proxy used when sending OPTIONS request
  717. ; (default: "")
  718. ;==========================AOR SECTION OPTIONS=========================
  719. ;[aor]
  720. ; SYNOPSIS: The configuration for a location of an endpoint
  721. ;contact= ; Permanent contacts assigned to AoR (default: "")
  722. ;default_expiration=3600 ; Default expiration time in seconds for
  723. ; contacts that are dynamically bound to an AoR
  724. ; (default: "3600")
  725. ;mailboxes= ; Mailbox es to be associated with (default: "")
  726. ;maximum_expiration=7200 ; Maximum time to keep an AoR (default: "7200")
  727. ;max_contacts=0 ; Maximum number of contacts that can bind to an AoR (default:
  728. ; "0")
  729. ;minimum_expiration=60 ; Minimum keep alive time for an AoR (default: "60")
  730. ;remove_existing=no ; Determines whether new contacts replace existing ones
  731. ; (default: "no")
  732. ;type= ; Must be of type aor (default: "")
  733. ;qualify_frequency=0 ; Interval at which to qualify an AoR (default: "0")
  734. ;authenticate_qualify=no ; Authenticates a qualify request if needed
  735. ; (default: "no")
  736. ;outbound_proxy= ; Outbound proxy used when sending OPTIONS request
  737. ; (default: "")
  738. ;==========================SYSTEM SECTION OPTIONS=========================
  739. ;[system]
  740. ; SYNOPSIS: Options that apply to the SIP stack as well as other system-wide settings
  741. ;timer_t1=500 ; Set transaction timer T1 value milliseconds (default: "500")
  742. ;timer_b=32000 ; Set transaction timer B value milliseconds (default: "32000")
  743. ;compact_headers=no ; Use the short forms of common SIP header names
  744. ; (default: "no")
  745. ;threadpool_initial_size=0 ; Initial number of threads in the res_pjsip
  746. ; threadpool (default: "0")
  747. ;threadpool_auto_increment=5 ; The amount by which the number of threads is
  748. ; incremented when necessary (default: "5")
  749. ;threadpool_idle_timeout=60 ; Number of seconds before an idle thread
  750. ; should be disposed of (default: "60")
  751. ;threadpool_max_size=0 ; Maximum number of threads in the res_pjsip threadpool
  752. ; A value of 0 indicates no maximum (default: "0")
  753. ;type= ; Must be of type system (default: "")
  754. ;==========================GLOBAL SECTION OPTIONS=========================
  755. ;[global]
  756. ; SYNOPSIS: Options that apply globally to all SIP communications
  757. ;max_forwards=70 ; Value used in Max Forwards header for SIP requests
  758. ; (default: "70")
  759. ;type= ; Must be of type global (default: "")
  760. ;user_agent=Asterisk PBX SVN-branch-12-r404375 ; Value used in User Agent
  761. ; header for SIP requests and
  762. ; Server header for SIP
  763. ; responses (default: "Asterisk
  764. ; PBX SVN-branch-12-r404375")
  765. ;default_outbound_endpoint=default_outbound_endpoint ; Endpoint to use when
  766. ; sending an outbound
  767. ; request to a URI
  768. ; without a specified
  769. ; endpoint (default: "d
  770. ; efault_outbound_endpo
  771. ; int")
  772. ;debug=no ; Enable/Disable SIP debug logging. Valid options include yes|no
  773. ; or a host address (default: "no")
  774. ; MODULE PROVIDING BELOW SECTION(S): res_pjsip_acl
  775. ;==========================ACL SECTION OPTIONS=========================
  776. ;[acl]
  777. ; SYNOPSIS: Access Control List
  778. ;acl= ; List of IP ACL section names in acl conf (default: "")
  779. ;contact_acl= ; List of Contact ACL section names in acl conf (default: "")
  780. ;contact_deny= ; List of Contact header addresses to deny (default: "")
  781. ;contact_permit= ; List of Contact header addresses to permit (default:
  782. ; "")
  783. ;deny= ; List of IP addresses to deny access from (default: "")
  784. ;permit= ; List of IP addresses to permit access from (default: "")
  785. ;type= ; Must be of type acl (default: "")
  786. ; MODULE PROVIDING BELOW SECTION(S): res_pjsip_outbound_registration
  787. ;==========================REGISTRATION SECTION OPTIONS=========================
  788. ;[registration]
  789. ; SYNOPSIS: The configuration for outbound registration
  790. ;auth_rejection_permanent=yes ; Determines whether failed authentication
  791. ; challenges are treated as permanent failures
  792. ; (default: "yes")
  793. ;client_uri= ; Client SIP URI used when attemping outbound registration
  794. ; (default: "")
  795. ;contact_user= ; Contact User to use in request (default: "")
  796. ;expiration=3600 ; Expiration time for registrations in seconds
  797. ; (default: "3600")
  798. ;max_retries=10 ; Maximum number of registration attempts (default: "10")
  799. ;outbound_auth= ; Authentication object to be used for outbound registrations
  800. ; (default: "")
  801. ;outbound_proxy= ; Outbound Proxy used to send registrations (default:
  802. ; "")
  803. ;retry_interval=60 ; Interval in seconds between retries if outbound
  804. ; registration is unsuccessful (default: "60")
  805. ;forbidden_retry_interval=0 ; Interval used when receiving a 403 Forbidden
  806. ; response (default: "0")
  807. ;server_uri= ; SIP URI of the server to register against (default: "")
  808. ;transport= ; Transport used for outbound authentication (default: "")
  809. ;type= ; Must be of type registration (default: "")
  810. ; MODULE PROVIDING BELOW SECTION(S): res_pjsip_endpoint_identifier_ip
  811. ;==========================IDENTIFY SECTION OPTIONS=========================
  812. ;[identify]
  813. ; SYNOPSIS: Identifies endpoints via source IP address
  814. ;endpoint= ; Name of Endpoint (default: "")
  815. ;match= ; IP addresses or networks to match against (default: "")
  816. ;type= ; Must be of type identify (default: "")
  817. ;========================PHONEPROV_USER SECTION OPTIONS=======================
  818. ;[phoneprov]
  819. ; SYNOPSIS: Contains variables for autoprovisioning each user
  820. ;endpoint= ; The endpoint from which to gather username, secret, etc. (default: "")
  821. ;PROFILE= ; The name of a profile configured in phoneprov.conf (default: "")
  822. ;MAC= ; The mac address for this user (default: "")
  823. ;OTHERVAR= ; Any other name value pair to be used in templates (default: "")
  824. ; Common variables include LINE, LINEKEYS, etc.
  825. ; See phoneprov.conf.sample for others.
  826. ;type= ; Must be of type phoneprov (default: "")