README.extconfig 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. Asterisk external configuration
  2. ===============================
  3. The Asterisk external configuration engine is the result of work by
  4. Anthony Minessale II, Mark Spencer and Constantine Filin.
  5. It is designed to provide a flexible, seamless integration between
  6. Asterisk's internal configuration structure and external SQL other other
  7. databases (maybe even LDAP one day).
  8. The external configuration engine is the basis for the ARA, the
  9. Asterisk Realtime Architecture (see README.realtime for more
  10. information).
  11. * Configuration
  12. External configuration is configured in /etc/asterisk/extconfig.conf
  13. allowing you to map any configuration file (static mappings) to
  14. be pulled from the database, or to map special runtime entries which
  15. permit the dynamic creation of objects, entities, peers, etc. without
  16. the necessity of a reload.
  17. Generally speaking, the columns in your tables should line up with the
  18. fields you would specify in the given entity declaration. If an entry
  19. would appear more than once, in the column it should be separated by a
  20. semicolon. For example, an entity that looks like:
  21. [foo]
  22. host=dynamic
  23. secret=bar
  24. context=default
  25. context=local
  26. could be stored in a table like this:
  27. +------+--------+-------+--------------+----------+-----+-----------+
  28. | name | host | secret| context | ipaddr | port| regseconds|
  29. +------+--------+-------+--------------+----------+-----+-----------+
  30. | foo | dynamic| bar | default;local| 127.0.0.1| 4569| 1096954152|
  31. +------+--------+-------+--------------+----------+-----+-----------+
  32. Note that for use with IAX or SIP, the table will also need the "name",
  33. "ipaddr", "port", "regseconds" columns. If you wanted to be able to
  34. configure the callerid, you could just add a callerid column to the
  35. table, for example.
  36. A SIP table would look more like this:
  37. +------+--------+-------+----------+-----+------------+----------+
  38. | name | host | secret| ipaddr | port| regseconds | username |
  39. +------+--------+-------+----------+-----+------------+----------+
  40. | foo | dynamic| bar | 127.0.0.1| 4569| 1096954152 | 1234 |
  41. +------+--------+-------+----------+-----+------------+----------+
  42. in order to store appropriate parameters required for SIP.
  43. A Voicemail table would look more like this:
  44. +----------+---------+----------+----------+-----------+---------------+
  45. | uniqueid | mailbox | context | password |email | fullname |
  46. +----------+---------+----------+----------+-----------+---------------+
  47. | 1 | 1234 | default | 4242 | a@b.com | Joe Schmoe |
  48. +----------+---------+----------+----------+-----------+---------------+
  49. The uniqueid should be unique to each voicemail user and can be
  50. autoincrement. It need not have any relation to the mailbox or context.
  51. An extension table would look more like this:
  52. +----------+---------+----------+-------+-----------+
  53. | context | exten | priority | app | appdata |
  54. +----------+---------+----------+-------+-----------+
  55. | default | 1234 | 1 | Dial | Zap/1 |
  56. +----------+---------+----------+-------+-----------+
  57. In the dialplan you just use the Realtime switch:
  58. [foo]
  59. switch => Realtime
  60. or:
  61. [bar]
  62. switch => Realtime/bar@extensions