<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 10">
<meta name=Originator content="Microsoft Word 10">
<link rel=File-List href="cid:filelist.xml@01C36B03.4E2CD220">
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:Zoom>110</w:Zoom>
<w:SpellingState>Clean</w:SpellingState>
<w:GrammarState>Clean</w:GrammarState>
<w:DocumentKind>DocumentEmail</w:DocumentKind>
<w:EnvelopeVis/>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0in;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;
        text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;
        text-underline:single;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        mso-style-noshow:yes;
        mso-ansi-font-size:10.0pt;
        mso-bidi-font-size:10.0pt;
        font-family:Arial;
        mso-ascii-font-family:Arial;
        mso-hansi-font-family:Arial;
        mso-bidi-font-family:Arial;
        color:windowtext;}
span.SpellE
        {mso-style-name:"";
        mso-spl-e:yes;}
span.GramE
        {mso-style-name:"";
        mso-gram-e:yes;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;
        mso-header-margin:.5in;
        mso-footer-margin:.5in;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
        {mso-style-name:"Table Normal";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0in 5.4pt 0in 5.4pt;
        mso-para-margin:0in;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";}
</style>
<![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple style='tab-interval:.5in'>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I thought I would post this in case it might be of any use
to anyone.<span style='mso-spacerun:yes'> </span>Not anything special but
it does work.<span style='mso-spacerun:yes'> </span>Keep in mind you need
sox and <span class=SpellE>wmix</span>.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Here is some relevant <span class=SpellE>exerpts</span> of my
<span class=SpellE>extensions.conf</span> using John <span class=SpellE><span
class=GramE>Todds</span></span> macro.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>[<span class=SpellE><span class=GramE>globals</span></span>]<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>CALLFILENAME=<span class=SpellE>foo</span><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>FOO=<span class=SpellE>foo</span><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>CALLERIDNUM=<span class=SpellE>foo</span><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>[<span class=GramE>default</span>]<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><span class=SpellE><span class=GramE><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>exten</span></font></span></span><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> =>
287,1,Macro(dial,SIP/agent20002|20)<o:p></o:p></span></font></p>
<p class=MsoNormal><span class=SpellE><span class=GramE><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>exten</span></font></span></span><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> =>
287,2,Voicemail(u287)<o:p></o:p></span></font></p>
<p class=MsoNormal><span class=SpellE><span class=GramE><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>exten</span></font></span></span><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> =>
h,1,Macro(<span class=SpellE>hangup</span>)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>[<span class=GramE>macro-dial</span>]<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><span class=SpellE><span class=GramE><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>exten</span></font></span></span><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> =>
s,1,AGI(set-<span class=SpellE>timestamp.agi</span>)<o:p></o:p></span></font></p>
<p class=MsoNormal><span class=SpellE><span class=GramE><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>exten</span></font></span></span><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> =>
s,2,SetVar(CALLFILENAME=${timestamp}-${CALLERIDNUM}-${MACRO_EXTEN})<o:p></o:p></span></font></p>
<p class=MsoNormal><span class=SpellE><span class=GramE><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>exten</span></font></span></span><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> =>
s,3,Monitor(wav,${CALLFILENAME})<o:p></o:p></span></font></p>
<p class=MsoNormal><span class=SpellE><span class=GramE><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>exten</span></font></span></span><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> => s,4,Dial(${ARG1},${ARG2},${ARG3})<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>[<span class=GramE>macro-<span class=SpellE>hangup</span></span>]<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><span class=SpellE><span class=GramE><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>exten</span></font></span></span><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> =>
s,1,SetVar(MONITORDIR=/<span class=SpellE>var</span>/spool/asterisk/monitor)<o:p></o:p></span></font></p>
<p class=MsoNormal><span class=SpellE><span class=GramE><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>exten</span></font></span></span><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> =>
s,2,GotoIf($[${CALLFILENAME} = ${FOO}]?6:3)<o:p></o:p></span></font></p>
<p class=MsoNormal><span class=SpellE><span class=GramE><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>exten</span></font></span></span><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> =>
s,3,System(/usr/local/bin/mix_monitor_files.pl ${MONITORDIR} ${CALLFILENAME}-<span
class=SpellE>in.wav</span> ${CALLFILENAME}-<span class=SpellE>out.wav</span>
${CALLFILENAME}.wav)<o:p></o:p></span></font></p>
<p class=MsoNormal><span class=SpellE><span class=GramE><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>exten</span></font></span></span><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> =>
s,6,NoOp<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Here is mix_monitor_files.pl.<span
style='mso-spacerun:yes'> </span><span class=GramE>sox</span> and <span
class=SpellE>wmix</span> must be in the path of your perl script<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><span class=GramE><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>#!/</span></font></span><span
class=SpellE><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
Arial'>usr</span></font></span><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>/bin/perl<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>$<span class=SpellE>monitordir</span> = shift;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>$<span class=SpellE>infile</span> = shift;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>$<span class=SpellE>outfile</span> = shift;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>$<span class=SpellE>finishfile</span> = shift;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><span class=SpellE><span class=GramE><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>chdir</span></font></span></span><span
class=GramE><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
Arial'>(</span></font></span><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>$<span class=SpellE>monitordir</span>);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>$<span class=SpellE>infile_output</span> = `sox $<span
class=SpellE>infile</span> -e stat 2>&1`;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>$<span class=SpellE>outfile_output</span> = `sox $<span
class=SpellE>outfile</span> -e stat 2>&1`;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>$<span class=SpellE>infile_output</span> =~ /Samples read<span
class=GramE>:\</span>s+(\d+)/;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>$<span class=SpellE>infile_samples</span> = $1;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>$<span class=SpellE>outfile_output</span> =~ /Samples read<span
class=GramE>:\</span>s+(\d+)/;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>$<span class=SpellE>outfile_samples</span> = $1;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><span class=GramE><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>if(</span></font></span><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>$<span
class=SpellE>outfile_samples</span> > $<span class=SpellE>infile_samples</span>)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>{<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><span
style='mso-spacerun:yes'> </span>$<span
class=SpellE>diff_samples</span> = $<span class=SpellE>outfile_samples</span> -
$<span class=SpellE>infile_samples</span>;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><span
style='mso-spacerun:yes'> </span><span
class=GramE>system(</span>"sox $<span class=SpellE>outfile</span> temp${<span
class=SpellE>outfile</span>} trim<span style='mso-spacerun:yes'>
</span>${<span class=SpellE>diff_samples</span>}s");<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><span
style='mso-spacerun:yes'> </span><span
class=GramE>system(</span>"<span class=SpellE>wmix</span> $<span
class=SpellE>infile</span> temp${<span class=SpellE>outfile</span>} > $<span
class=SpellE>finishfile</span>");<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><span
style='mso-spacerun:yes'> </span><span
class=GramE>system(</span>"<span class=SpellE>rm</span> -f $<span
class=SpellE>infile</span> temp${<span class=SpellE>outfile</span>} $<span
class=SpellE>outfile</span>");<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><span class=SpellE><span class=GramE><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>elsif</span></font></span></span><span
class=GramE><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
Arial'>(</span></font></span><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>$<span class=SpellE>infile_samples</span> > $<span
class=SpellE>outfile_samples</span>)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>{<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><span
style='mso-spacerun:yes'> </span>$<span
class=SpellE>diff_samples</span> = $<span class=SpellE>infile_samples</span> -
$<span class=SpellE>outfile_samples</span>;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><span
style='mso-spacerun:yes'> </span><span
class=GramE>system(</span>"sox $<span class=SpellE>infile</span> temp${<span
class=SpellE>infile</span>} trim<span style='mso-spacerun:yes'> </span>${<span
class=SpellE>diff_samples</span>}s");<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><span
style='mso-spacerun:yes'> </span><span
class=GramE>system(</span>"<span class=SpellE>wmix</span> temp${<span
class=SpellE>infile</span>} $<span class=SpellE>outfile</span> > $<span
class=SpellE>finishfile</span>");<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><span
style='mso-spacerun:yes'> </span><span
class=GramE>system(</span>"<span class=SpellE>rm</span> -f temp${<span
class=SpellE>infile</span>} $<span class=SpellE>outfile</span> $<span
class=SpellE>infile</span>");<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><span class=GramE><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>else</span></font></span><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>{<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><span
style='mso-spacerun:yes'> </span><span
class=GramE>system(</span>"<span class=SpellE>wmix</span> $<span
class=SpellE>infile</span> $<span class=SpellE>outfile</span> > $<span
class=SpellE>finishfile</span>");<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><span
style='mso-spacerun:yes'> </span><span
class=GramE>system(</span>"<span class=SpellE>rm</span> -f $<span
class=SpellE>infile</span> $<span class=SpellE>outfile</span>");<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>}<o:p></o:p></span></font></p>
</div>
</body>
</html>