callfiles.txt 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. Asterisk call files
  2. ===================
  3. Asterisk has the ability to initiate a call from outside of the normal
  4. methods such as the dialplan, manager interface, or spooling interface.
  5. Using the call file method, you must give Asterisk the following information:
  6. * How to perform the call, similar to the Dial() application
  7. * What to do when the call is answered
  8. With call files you submit this information simply by creating a file with
  9. the required syntax and placing it in the outgoing spooling directory, located
  10. by default in /var/spool/asterisk/outgoing/ (configurable in asterisk.conf).
  11. The pbx_spool module aggressively examines the directory contents every second,
  12. creating a new call for every call file it finds. Do NOT write or create
  13. the call file directly in the outgoing directory, but always create the file
  14. in another directory of the same filesystem and then move the file to the
  15. /var/spool/asterisk/outgoing directory, or Asterisk may read just a partial
  16. file.
  17. The call file syntax
  18. ====================
  19. The call file consists of <Key>: <value> pairs; one per line.
  20. Comments are indicated by a '#' character that begins a line, or follows a space
  21. or tab character. To be consistent with the configuration files in Asterisk,
  22. comments can also be indicated by a semicolon. However, the multiline comments
  23. (;-- --;) used in Asterisk configuration files are not supported. Semicolons can
  24. be escaped by a backslash.
  25. The following keys-value pairs are used to specify how setup a call:
  26. Channel: <channel> the channel to use for the new call, in the form
  27. technology/resource as in the Dial application. This
  28. value is required.
  29. Callerid: <callerid> the caller id to use.
  30. WaitTime: <number> how many seconds to wait for an answer before the call
  31. fails (ring cycle). Default 45 seconds.
  32. Maxretries: <number> number of retries before failing, not including the
  33. initial attempt. Default = 0 e.g. don't retry if fails.
  34. RetryTime: <number> how many seconds to wait before retry. The default is
  35. 300 (5 minutes).
  36. Account: <account> the account code for the call. This value will be
  37. assigned to CDR(accountcode)
  38. When the call answers there are two choices:
  39. * Execute a single application, or
  40. * Execute the dialplan at the specified context/extension/priority.
  41. To execute an application:
  42. --------------------------
  43. Application: <appname> the application to execute
  44. Data: <args> the application arguments
  45. To start executing applications in the dialplan:
  46. ------------------------------------------------
  47. Context: <context> the context in the dialplan
  48. Extension: <exten> the extension in the specified context
  49. Priority: <priority> the priority of the specified extension
  50. (numeric or label)
  51. Setvar: <var=value> you may also assign values to variables that will be
  52. available to the channel, as if you had performed a
  53. Set(var=value) in the dialplan. More than one Setvar:
  54. maybe specified.
  55. The processing of the call file ends when the call is answered and terminated; when
  56. the call was not answered in the initial attempt and subsequent retries; or if
  57. the call file can't be successfully read and parsed.
  58. To specify what to do with the call file at the end of processing:
  59. Archive: <yes|no> if "no" the call file is deleted. If set to "yes" the
  60. call file is moved to the "outgoing_done" subdirectory
  61. of the Asterisk spool directory. The default is to
  62. delete the call file.
  63. If the call file is archived, Asterisk will append to the call file:
  64. Status: <exitstatus> can be "Expired", "Completed" or "Failed"
  65. Other lines generated by Asterisk:
  66. Asterisk keep track of how many retries the call has already attempted,
  67. appending to the call file the following key-pairs in the form:
  68. StartRetry: <pid> <retrycount> (<time>)
  69. EndRetry: <pid> <retrycount> (<time>)
  70. With the main process ID (pid) of the Asterisk process, the retry number, and
  71. the attempts start and end times in time_t format.
  72. Directory locations
  73. ===================
  74. <astspooldir>/outgoing the outgoing dir, where call files are put
  75. for processing
  76. <astspooldir>/outgoing_done the archive dir
  77. <astspooldir> is specified in asterisk.conf, usually /var/spool/asterisk
  78. How to schedule a call
  79. ======================
  80. Call files that have the time of the last modification in the future are ignored
  81. by Asterisk. This makes it possible to modify the time of a call file to the
  82. wanted time, move to the outgoing directory, and Asterisk will attempt to
  83. create the call at that time.