<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Monitor()</title><link rel="stylesheet" href="styles.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /><link rel="start" href="index.html" title="Asterisk™: The Future of Telephony" /><link rel="up" href="asterisk-APP-B.html" title="Appendix B. Application Reference" /><link rel="prev" href="asterisk-APP-B-303.html" title="MixMonitor()" /><link rel="next" href="asterisk-APP-B-315.html" title="MorseCode()" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Monitor()</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="asterisk-APP-B-303.html">Prev</a> </td><th width="60%" align="center">Appendix B. Application Reference</th><td width="20%" align="right"> <a accesskey="n" href="asterisk-APP-B-315.html">Next</a></td></tr></table><hr /></div><div class="refentry" lang="en" xml:lang="en"><a id="asterisk-APP-B-117"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>Monitor() — Monitors (records) the audio on the current channel</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><a id="I_programlisting_tt2293"></a><pre class="programlisting">Monitor([<em class="replaceable"><code>file_format</code></em>[:<em class="replaceable"><code>urlbase</code></em>][,<em class="replaceable"><code>fname_base</code></em>][,<em class="replaceable"><code>options</code></em>]])</pre></div><div class="refsect1" lang="en" xml:lang="en"><a id="id4190201"></a><h2></h2><p><a id="I_indexterm_tt2294" class="indexterm"></a>Starts monitoring a channel. The channel’s input and output voice packets are logged to files until the channel hangs up or monitoring is stopped by the <code class="literal">StopMonitor()</code> <span class="keep-together">application</span>.</p><p><code class="literal">Monitor()</code> takes the following arguments:</p><div class="variablelist"><dl><dt><span class="term"> <em class="replaceable"><code>file_format</code></em> </span></dt><dd><p>Specifies the file format. If not set, defaults to <code class="literal">wav</code>.</p></dd><dt><span class="term"> <em class="replaceable"><code>fname_base</code></em> </span></dt><dd><p>If set, changes the filename used to the one specified.</p></dd><dt><span class="term"> <em class="replaceable"><code>options</code></em> </span></dt><dd><p>One of two options can be specified:</p><div class="variablelist"><dl><dt><span class="term"> <code class="literal">m</code> </span></dt><dd><p>When the recording ends, mix the two leg files in to one and delete the original leg files. If the variable <code class="literal">${MONITOR_EXEC}</code> is set, the application referenced in it will be executed instead of <span class="emphasis"><em>soxmix</em></span>, and the raw leg files will <span class="emphasis"><em>not</em></span> be deleted automatically. <span class="emphasis"><em>soxmix</em></span> (or <code class="literal">${MONITOR_EXEC}</code>) is handed three arguments: the two leg files and the filename for the target mixed file, which is the same as the leg filenames but without the in/out designator. If <code class="literal">${MONITOR_EXEC_ARGS}</code> is set, the contents will be passed on as additional arguments to <code class="literal">${MONITOR_EXEC}</code>. Both <code class="literal">${MONITOR_EXEC}</code> and the <code class="literal">m</code> flag can be set from the administrator interface.</p></dd><dt><span class="term"> <code class="literal">b</code> </span></dt><dd><p>Don’t begin recording unless a call is bridged to another channel.</p></dd></dl></div></dd></dl></div><a id="I_programlisting_tt2295"></a><pre class="programlisting">exten => 123,1,Answer() ; record the current channel, and mix the audio channels at the end of ; recording <span class="strong"><strong>exten => 123,2,Monitor(wav,monitor_test,mb)</strong></span> exten => 123,3,SayDigits(12345678901234567890) exten => 123,4,StopMonitor()</pre></div><div class="refsect1" lang="en" xml:lang="en"><a id="asterisk-APP-B-118"></a><h2>See Also</h2><p><a href="asterisk-APP-B-31.html" title="ChangeMonitor()"><span class="refentrytitle">ChangeMonitor()</span></a>, <a href="asterisk-APP-B-214.html" title="StopMonitor()"><span class="refentrytitle">StopMonitor()</span></a>, <a href="asterisk-APP-B-303.html" title="MixMonitor()"><span class="refentrytitle">MixMonitor()</span></a>, <a href="asterisk-APP-B-320.html" title="PauseMonitor()"><span class="refentrytitle">PauseMonitor()</span></a>, <a href="asterisk-APP-B-319.html" title="UnpauseMonitor()"><span class="refentrytitle">UnpauseMonitor()</span></a></p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="asterisk-APP-B-303.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="asterisk-APP-B.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="asterisk-APP-B-315.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">MixMonitor() </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> MorseCode()</td></tr></table></div><div xmlns="" id="svn-footer"><hr /><p>You are reading <em>Asterisk: The Future of Telephony</em> (2nd Edition for Asterisk 1.4), by Jim van Meggelen, Jared Smith, and Leif Madsen.<br /> This work is licensed under the <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative Commons Attribution-Noncommercial-No Derivative Works License v3.0</a>.<br /> To submit comments, corrections, or other contributions to the text, please visit <a href="http://oreilly.com/catalog/9780596510480/">http://www.oreilly.com/</a>.</p></div></body></html>