Asterisk-13-Function_CDR_29394649.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Asterisk Project : Asterisk 13 Function_CDR</title>
  5. <link rel="stylesheet" href="styles/site.css" type="text/css" />
  6. <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. </head>
  8. <body class="theme-default aui-theme-default">
  9. <div id="page">
  10. <div id="main" class="aui-page-panel">
  11. <div id="main-header">
  12. <div id="breadcrumb-section">
  13. <ol id="breadcrumbs">
  14. <li class="first">
  15. <span><a href="index.html">Asterisk Project</a></span>
  16. </li>
  17. <li>
  18. <span><a href="Asterisk-13-Command-Reference_29394274.html">Asterisk 13 Command Reference</a></span>
  19. </li>
  20. <li>
  21. <span><a href="Asterisk-13-Dialplan-Functions_29394287.html">Asterisk 13 Dialplan Functions</a></span>
  22. </li>
  23. </ol>
  24. </div>
  25. <h1 id="title-heading" class="pagetitle">
  26. <span id="title-text">
  27. Asterisk Project : Asterisk 13 Function_CDR
  28. </span>
  29. </h1>
  30. </div>
  31. <div id="content" class="view">
  32. <div class="page-metadata">
  33. Created by <span class='author'> wikibot</span> on Aug 08, 2014
  34. </div>
  35. <div id="main-content" class="wiki-content group">
  36. <h1 id="Asterisk13Function_CDR-CDR()">CDR()</h1>
  37. <h3 id="Asterisk13Function_CDR-Synopsis">Synopsis</h3>
  38. <p>Gets or sets a CDR variable.</p>
  39. <h3 id="Asterisk13Function_CDR-Description">Description</h3>
  40. <p>All of the CDR field names are read-only, except for <code>accountcode</code>, <code>userfield</code>, and <code>amaflags</code>. You may, however, supply a name not on the above list, and create your own variable, whose value can be changed with this function, and this variable will be stored on the CDR.</p>
  41. <div class="aui-message hint shadowed information-macro">
  42. <p class="title">Note</p>
  43. <span class="aui-icon icon-hint">Icon</span>
  44. <div class="message-content">
  45. <p>CDRs can only be modified before the bridge between two channels is torn down. For example, CDRs may not be modified after the <code>Dial</code> application has returned.</p>
  46. </div>
  47. </div>
  48. <p>Example: exten =&gt; 1,1,Set(CDR(userfield)=test)</p>
  49. <h3 id="Asterisk13Function_CDR-Syntax">Syntax</h3>
  50. <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
  51. <pre>CDR(name[,options])</pre>
  52. </div></div>
  53. <h5 id="Asterisk13Function_CDR-Arguments">Arguments</h5>
  54. <ul>
  55. <li><code>name</code> - CDR field name:
  56. <ul>
  57. <li><code>clid</code> - Caller ID.</li>
  58. <li><code>lastdata</code> - Last application arguments.</li>
  59. <li><code>disposition</code> - The final state of the CDR.
  60. <ul>
  61. <li><code>0</code> - NO ANSWER</li>
  62. <li><code>1</code> - NO ANSWER (NULL record)</li>
  63. <li><code>2</code> - FAILED</li>
  64. <li><code>4</code> - BUSY</li>
  65. <li><code>8</code> - ANSWERED</li>
  66. <li><code>16</code> - CONGESTION</li>
  67. </ul>
  68. </li>
  69. <li><code>src</code> - Source.</li>
  70. <li><code>start</code> - Time the call started.</li>
  71. <li><code>amaflags</code> - R/W the Automatic Message Accounting (AMA) flags on the channel. When read from a channel, the integer value will always be returned. When written to a channel, both the string format or integer value is accepted.
  72. <ul>
  73. <li><code>1</code> - OMIT</li>
  74. <li><code>2</code> - BILLING</li>
  75. <li><code>3</code> - DOCUMENTATION
  76. <div class="aui-message problem shadowed information-macro">
  77. <p class="title">Warning</p>
  78. <span class="aui-icon icon-problem">Icon</span>
  79. <div class="message-content">
  80. <p>Accessing this setting is deprecated in CDR. Please use the CHANNEL function instead.</p>
  81. </div>
  82. </div>
  83. </li>
  84. </ul>
  85. </li>
  86. <li><code>dst</code> - Destination.</li>
  87. <li><code>answer</code> - Time the call was answered.</li>
  88. <li><code>accountcode</code> - The channel's account code.
  89. <div class="aui-message problem shadowed information-macro">
  90. <p class="title">Warning</p>
  91. <span class="aui-icon icon-problem">Icon</span>
  92. <div class="message-content">
  93. <p>Accessing this setting is deprecated in CDR. Please use the CHANNEL function instead.</p>
  94. </div>
  95. </div>
  96. </li>
  97. <li><code>dcontext</code> - Destination context.</li>
  98. <li><code>end</code> - Time the call ended.</li>
  99. <li><code>uniqueid</code> - The channel's unique id.</li>
  100. <li><code>dstchannel</code> - Destination channel.</li>
  101. <li><code>duration</code> - Duration of the call.</li>
  102. <li><code>userfield</code> - The channel's user specified field.</li>
  103. <li><code>lastapp</code> - Last application.</li>
  104. <li><code>billsec</code> - Duration of the call once it was answered.</li>
  105. <li><code>channel</code> - Channel name.</li>
  106. <li><code>sequence</code> - CDR sequence number.</li>
  107. </ul>
  108. </li>
  109. <li><code>options</code>
  110. <ul>
  111. <li><code>f</code> - Returns billsec or duration fields as floating point values.</li>
  112. <li><code>u</code> - Retrieves the raw, unprocessed value.<br />
  113. For example, 'start', 'answer', and 'end' will be retrieved as epoch values, when the <code>u</code> option is passed, but formatted as YYYY-MM-DD HH:MM:SS otherwise. Similarly, disposition and amaflags will return their raw integral values.</li>
  114. </ul>
  115. </li>
  116. </ul>
  117. <h3 id="Asterisk13Function_CDR-SeeAlso">See Also</h3>
  118. <h3 id="Asterisk13Function_CDR-ImportVersion">Import Version</h3>
  119. <p>This documentation was imported from Asterisk Version SVN-branch-13-r420538</p>
  120. </div>
  121. </div> </div>
  122. <div id="footer">
  123. <section class="footer-body">
  124. <p>Document generated by Confluence on Aug 11, 2014 13:46</p>
  125. </section>
  126. </div>
  127. </div> </body>
  128. </html>