<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/en/2172/18/9/_/styles/combined.css?spaceKey=AST&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Application_Monitor">Asterisk 11 Application_Monitor</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://wiki.asterisk.org/wiki/display/~wikibot">Wiki Bot</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h1><a name="Asterisk11Application_Monitor-Monitor%28%29"></a>Monitor()</h1>

<h3><a name="Asterisk11Application_Monitor-Synopsis"></a>Synopsis</h3>

<p>Monitor a channel.</p>
<h3><a name="Asterisk11Application_Monitor-Description"></a>Description</h3>



<p>Used to start 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 StopMonitor application.</p>

<p>By default, files are stored to <tt>/var/spool/asterisk/monitor/</tt>. Returns <tt>-1</tt> if monitor files can't be opened or if the channel is already monitored, otherwise <tt>0</tt>.</p>

<h3><a name="Asterisk11Application_Monitor-Syntax"></a>Syntax</h3>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>Monitor(file_format:urlbase,fname_base,options)</pre>
</div></div>
<h5><a name="Asterisk11Application_Monitor-Arguments"></a>Arguments</h5>


<ul>
        <li>file_format
        <ul>
                <li>file_format - optional, if not set, defaults to <tt>wav</tt></li>
                <li>urlbase</li>
        </ul>
        </li>
        <li>fname_base - if set, changes the filename used to the one specified.</li>
        <li>options
        <ul>
                <li>m - when the recording ends mix the two leg files into one and delete the two leg files. If the variable <tt>MONITOR_EXEC</tt> is set, the application referenced in it will be executed instead of soxmix/sox and the raw leg files will NOT be deleted automatically. soxmix/sox or <tt>MONITOR_EXEC</tt> is handed 3 arguments, the two leg files and a target mixed file name which is the same as the leg file names only without the in/out designator.If <tt>MONITOR_EXEC_ARGS</tt> is set, the contents will be passed on as additional arguments to <tt>MONITOR_EXEC</tt>. Both <tt>MONITOR_EXEC</tt> and the Mix flag can be set from the administrator interface.</li>
                <li>b - Don't begin recording unless a call is bridged to another channel.</li>
                <li>i - Skip recording of input stream (disables <tt>m</tt> option).</li>
                <li>o - Skip recording of output stream (disables <tt>m</tt> option).</li>
        </ul>
        </li>
</ul>


<h3><a name="Asterisk11Application_Monitor-SeeAlso"></a>See Also</h3>


<ul>
        <li><a href="/wiki/pages/createpage.action?spaceKey=AST&amp;title=Asterisk+11+Application_StopMonitor&amp;linkCreation=true&amp;fromPageId=20187415" class="createlink">Asterisk 11 Application&#95;StopMonitor</a></li>
</ul>


<h3><a name="Asterisk11Application_Monitor-ImportVersion"></a>Import Version</h3>

<p>This documentation was imported from Asterisk Version SVN-trunk-r370322</p>
    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;" class="grey">
                        <a href="https://wiki.asterisk.org/wiki/users/removespacenotification.action?spaceKey=AST">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://wiki.asterisk.org/wiki/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
       <a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Application_Monitor">View Online</a>
              |
       <a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Application_Monitor?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>