<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I use this form for convert wav to mp3 and it's working:<br>
    <pre>exten =&gt; s,n(record),MixMonitor(${MIXMON_DIR}${CALLFILENAME}.${MIXMON_FORMAT},,/usr/bin/lame --preset voice -v -B 64 -a /var/spool/asterisk/monitor/${CALLFILENAME}.${MIXMON_FORMAT} /var/spool/asterisk/monitor/${CALLFILENAME}.mp3)</pre>
    you can see that all are explicits paths, otherwise it will not
    work.<br>
    <br>
    bye<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Il 05/07/2013 15:45, Gopalakrishnan N
      scrisse:<br>
    </div>
    <blockquote
cite="mid:CAEymo13nWX6EMR6BQ7Dz6C2EFFZaJzeX3xKB5vXwdfHJgZm4aA@mail.gmail.com"
      type="cite">
      <div dir="ltr">I tried with the ^ symbol but still there is no
        success.&nbsp;
        <div><br>
        </div>
        <div>And regards to the path, actually my file is in path /root,
          is that to be in /usr/sbin or somewhere?</div>
        <div><br>
        </div>
        <div>Basically am able to see the application executed in the
          CLI, like the below,</div>
        <div><br>
        </div>
        <div>
          <div>&nbsp;<span style="background-color:rgb(255,255,0)">Executing
              [4090@test:1] Set("SIP/4092-0000003b",
              "START_TIME=2013-07-05_14:43:11") in new stack</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; &nbsp; --
              Executing [4090@test:2] Set("SIP/4092-0000003b",
              "MIXMONITOR_FILENAME=4090-2013-07-05_14:43:11-OUT") in new
              stack</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; &nbsp; --
              Executing [4090@test:3] MixMonitor("SIP/4092-0000003b",
              "IND_PRI/4092/OUT/2013-07/05/4090-2013-07-05_14:43:11-OUT.wav,b,/root/flac.sh
              4090-2013-07-05_14:43:11-OUT") in new stack</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; &nbsp; --
              Executing [4090@test:4] Set("SIP/4092-0000003b",
              "CDR(userfield)=/var/spool/asterisk/monitor/IND_PRI/4092/OUT/2013-07/05/4090-2013-07-05_14:43:11-OUT.wav")
              in new stack</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; &nbsp; --
              Executing [4090@test:5] Dial("SIP/4092-0000003b",
              "SIP/4090,30") in new stack</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; == Using
              SIP RTP CoS mark 5</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; == Begin
              MixMonitor Recording SIP/4092-0000003b</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; &nbsp; --
              Called SIP/4090</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; &nbsp; --
              SIP/4090-0000003c is ringing</span><br>
          </div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; &nbsp; --
              SIP/4090-0000003c answered SIP/4092-0000003b</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; &nbsp; --
              fixed jitterbuffer created on channel SIP/4090-0000003c</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; &nbsp; --
              fixed jitterbuffer created on channel SIP/4092-0000003b</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; &nbsp; --
              Executing [h@test:1] MYSQL("SIP/4092-0000003b", "Connect
              connid localhost root Iopex1063 Logs") in new stack</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; &nbsp; --
              Executing [h@test:2] MYSQL("SIP/4092-0000003b", "Query
              resultid 1 insert into
              call_log(accountcode,start,end,src,dst,uniqueid,userfield,hangupcause)
              values("4092","2013-07-05
              14:43:11",now(),30993091,4090,1373049791.59,"/var/spool/asterisk/monitor/IND_PRI/4092/OUT/2013-07/05/4090-2013-07-05_14:43:11-OUT.wav",16)")
              in new stack</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; &nbsp; --
              Executing [h@test:3] MYSQL("SIP/4092-0000003b",
              "Disconnect 1") in new stack</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; &nbsp; --
              fixed jitterbuffer destroyed on channel SIP/4090-0000003c</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; == Spawn
              extension (test, 4090, 5) exited non-zero on
              'SIP/4092-0000003b'</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; &nbsp; --
              fixed jitterbuffer destroyed on channel SIP/4092-0000003b</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; ==
              MixMonitor close filestream</span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; </span><span
              style="background-color:rgb(255,0,0)">== <b>Executing
                [/root/flac.sh 4090-2013-07-05_14:43:11-OUT]</b></span></div>
          <div><span style="background-color:rgb(255,255,0)">&nbsp; == End
              MixMonitor Recording SIP/4092-0000003b</span></div>
        </div>
        <div><br>
        </div>
        <div>But the file is not converted, I suspect it could be a path
          issue.&nbsp;</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Regards</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Fri, Jul 5, 2013 at 10:59 AM, Satish
          Barot <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:satish4asterisk@gmail.com" target="_blank">satish4asterisk@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>
                <div class="h5">
                  <div class="gmail_extra">
                    <div class="gmail_quote">On Fri, Jul 5, 2013 at 1:45
                      AM, Gopalakrishnan N <span dir="ltr">&lt;<a
                          moz-do-not-send="true"
                          href="mailto:gopalakrishnan.an@gmail.com"
                          target="_blank">gopalakrishnan.an@gmail.com</a>&gt;</span>
                      wrote:<br>
                      <blockquote class="gmail_quote" style="margin:0px
                        0px 0px 0.8ex;border-left:1px solid
                        rgb(204,204,204);padding-left:1ex">
                        <p dir="ltr">exten =&gt;
                          _4X.,1,Set(START_TIME=${STRFTIME(${EPOCH},,%Y-%m-%d_%H:%M:%S)})<br>
                          exten =&gt;
                          _4X.,n,Set(MIXMONITOR_FILENAME=${EXTEN}-${START_TIME}-OUT)<br>
                          ;exten =&gt;
                          _4X.,n,MixMonitor(IND_PRI/${CDR(accountcode)}/OUT/${STRFTIME(${EPOCH},,%Y-%m)}/${STRFTIME(${EPOCH},,%d)}/${MIXMONITOR_FILENAME}.wav,m,/root/flac.sh
                          ${MIXMONITOR_FILENAME}.wav)<br>
                          exten =&gt;
                          _4X.,n,MixMonitor(IND_PRI/${CDR(accountcode)}/OUT/${STRFTIME(${EPOCH},,%Y-%m)}/${STRFTIME(${EPOCH},,%d)}/${MIXMONITOR_FILENAME}.wav,b,/root/flac.sh
                          ${MIXMONITOR_FILENAME}.wav)<br>
                          exten =&gt;
_4X.,n,Set(CDR(userfield)=IND_PRI/${CDR(accountcode)}/OUT/${STRFTIME(${EPOCH},,%Y-%m)}/${STRFTIME(${EPOCH},,%d)}/${MIXMONITOR_FILENAME})<br>
                          exten =&gt; _4X.,n,Dial(SIP/${EXTEN},30)<br>
                          exten =&gt; _4X.,n,Hangup</p>
                        <p dir="ltr">Regards<br>
                        </p>
                        <div class="gmail_quote">
                          <div>
                            <div>On 4 Jul 2013 11:18, "Satish Barot"
                              &lt;<a moz-do-not-send="true"
                                href="mailto:satish4asterisk@gmail.com"
                                target="_blank">satish4asterisk@gmail.com</a>&gt;
                              wrote:<br type="attribution">
                            </div>
                          </div>
                          <blockquote class="gmail_quote"
                            style="margin:0px 0px 0px
                            0.8ex;border-left:1px solid
                            rgb(204,204,204);padding-left:1ex">
                            <div>
                              <div>
                                <div dir="ltr">
                                  <div class="gmail_extra">
                                    <div class="gmail_quote">On Thu, Jul
                                      4, 2013 at 1:30 AM, Gopalakrishnan
                                      N <span dir="ltr">&lt;<a
                                          moz-do-not-send="true"
                                          href="mailto:gopalakrishnan.an@gmail.com"
                                          target="_blank">gopalakrishnan.an@gmail.com</a>&gt;</span>
                                      wrote:<br>
                                      <blockquote class="gmail_quote"
                                        style="margin:0px 0px 0px
                                        0.8ex;border-left:1px solid
                                        rgb(204,204,204);padding-left:1ex">
                                        <p dir="ltr">I tried with hangup
                                          cause but my script is not
                                          executed... also I tried the
                                          same script with mix monitor
                                          itself no sucess.</p>
                                        <p dir="ltr">The script what I
                                          have is, am converting wav
                                          file to flac format..</p>
                                        <div>
                                          <div>
                                            <div class="gmail_quote">On
                                              11 Jun 2013 11:17, "Satish
                                              Barot" &lt;<a
                                                moz-do-not-send="true"
                                                href="mailto:satish4asterisk@gmail.com"
                                                target="_blank">satish4asterisk@gmail.com</a>&gt;
                                              wrote:<br
                                                type="attribution">
                                              <blockquote
                                                class="gmail_quote"
                                                style="margin:0px 0px
                                                0px
                                                0.8ex;border-left:1px
                                                solid
                                                rgb(204,204,204);padding-left:1ex">
                                                <div class="gmail_extra">And
                                                  yes if you want to use
                                                  System application in
                                                  your dialplan then
                                                  have System in your h
                                                  extension<br>
                                                  <pre style="line-height:normal;text-indent:0px;letter-spacing:normal;text-align:start;font-variant:normal;text-transform:none;font-style:normal;font-weight:normal;word-spacing:0px">
</pre>
                                                  <pre style="line-height:normal;text-indent:0px;letter-spacing:normal;text-align:start;font-variant:normal;text-transform:none;font-style:normal;font-weight:normal;word-spacing:0px">System(/PathToSox/sox -r 8000 -c 1 /PathToWavFile/filename.wav /PathToMp3FileToBE Stored/filename.mp3)





</pre>
                                                  <div
                                                    class="gmail_quote">On
                                                    Tue, Jun 11, 2013 at
                                                    10:38 AM, Satish
                                                    Barot <span
                                                      dir="ltr">&lt;<a
                                                        moz-do-not-send="true"
href="mailto:satish4asterisk@gmail.com" target="_blank">satish4asterisk@gmail.com</a>&gt;</span>
                                                    wrote:<br>
                                                    <blockquote
                                                      class="gmail_quote"
                                                      style="margin:0px
                                                      0px 0px
                                                      0.8ex;border-left:1px
                                                      solid
                                                      rgb(204,204,204);padding-left:1ex">
                                                      <div
                                                        class="gmail_extra">
                                                        <div>Hi
                                                          Gopamkrishnan,<br>
                                                          <br>
                                                        </div>
                                                        Check the
                                                        'command'
                                                        argument for
                                                        Mixmonitor.
                                                        Mixmonitor
                                                        itself has a
                                                        facility to
                                                        execute a
                                                        command when
                                                        recording is
                                                        over. <br>
                                                        <pre style="line-height:normal;text-indent:0px;letter-spacing:normal;text-align:start;font-variant:normal;text-transform:none;font-style:normal;font-weight:normal;word-spacing:0px"><i>In my case, 'wav2mp3' is a script which gets executed and converts recorded wav audio file to mp3. I pass ${FILENAME} as an argument to my script.
</i></pre>
                                                        <pre style="line-height:normal;text-indent:0px;letter-spacing:normal;text-align:start;font-variant:normal;text-transform:none;font-style:normal;font-weight:normal;word-spacing:0px"><i>You should have something like </i>MixMonitor(filename.wav,m,/PathToYourScript/YourScriptName^filename.wav) in your dialplan.




</pre>
                                                        <pre style="line-height:normal;text-indent:0px;letter-spacing:normal;text-align:start;font-variant:normal;text-transform:none;font-style:normal;font-weight:normal;word-spacing:0px">Hope this helps.

</pre>
                                                        <pre style="line-height:normal;text-indent:0px;letter-spacing:normal;text-align:start;font-variant:normal;text-transform:none;font-style:normal;font-weight:normal;word-spacing:0px">--Satish Barot
</pre>
                                                        <pre style="line-height:normal;text-indent:0px;letter-spacing:normal;text-align:start;font-variant:normal;text-transform:none;font-style:normal;font-weight:normal;word-spacing:0px">
Ahmedabad, India
</pre>
                                                        <br>
                                                        <div
                                                          class="gmail_quote">On
                                                          Tue, Jun 11,
                                                          2013 at 9:31
                                                          AM,
                                                          Gopalakrishnan
                                                          N <span
                                                          dir="ltr">&lt;<a
moz-do-not-send="true" href="mailto:gopalakrishnan.an@gmail.com"
                                                          target="_blank">gopalakrishnan.an@gmail.com</a>&gt;</span>
                                                          wrote:<br>
                                                          <blockquote
                                                          class="gmail_quote"
                                                          style="margin:0px
                                                          0px 0px
                                                          0.8ex;border-left:1px
                                                          solid
                                                          rgb(204,204,204);padding-left:1ex">
                                                          <div dir="ltr">Hi
                                                          Satish,
                                                          <div><br>
                                                          </div>
                                                          <div>I tried
                                                          with sox,
                                                          without any
                                                          parameter,
                                                          just sox
                                                          filename.wav
                                                          to
                                                          filename.mp3,
                                                          in linux shell
                                                          prompt... the
                                                          file is been
                                                          converted...&nbsp;</div>
                                                          <div><br>
                                                          </div>
                                                          <div>
                                                          Now If i want
                                                          to run that
                                                          command using
                                                          dialplan,&nbsp;</div>
                                                          <div><br>
                                                          </div>
                                                          <div>MixMonitor(filename.wav,m)</div>
                                                          <div>Monitor_Exec(sox
                                                          filename.wav
                                                          filename.mp3)&nbsp;</div>
                                                          <div><br>
                                                          </div>
                                                          <div>Or to use
                                                          System
                                                          command?</div>
                                                          <div><br>
                                                          </div>
                                                          <div>Regards..&nbsp;</div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <div
                                                          class="gmail_extra"><br>
                                                          <br>
                                                          <div
                                                          class="gmail_quote">On
                                                          Fri, Jan 27,
                                                          2012 at 11:29
                                                          AM, Satish
                                                          Barot <span
                                                          dir="ltr">&lt;<a
moz-do-not-send="true" href="mailto:satish4asterisk@gmail.com"
                                                          target="_blank">satish4asterisk@gmail.com</a>&gt;</span>
                                                          wrote:<br>
                                                          <blockquote
                                                          class="gmail_quote"
                                                          style="margin:0px
                                                          0px 0px
                                                          0.8ex;border-left:1px
                                                          solid
                                                          rgb(204,204,204);padding-left:1ex">This
                                                          is how I use a
                                                          wav to mp3
                                                          script on
                                                          Mixmonitor in
                                                          my dialplan
                                                          (Asterisk
                                                          1.8.7.0).<br>
                                                          ...<br>
                                                          same =&gt;
                                                          n,MixMonitor(${FILENAME},W(4),/var/spool/asterisk/wav2mp3
                                                          ^{FILENAME})<br>
                                                          ...<br>
                                                          and my script
                                                          is...<br>
                                                          <br>
                                                          #!/bin/bash<br>
                                                          <br>
WAV="/var/spool/asterisk/monitor/$1"<br>
                                                          MP3=$(echo $1
                                                          | sed
                                                          's/\.wav$/.mp3/')<br>
MP3DEST="/var/spool/asterisk/mp3/$MP3"<br>
                                                          /usr/bin/lame
                                                          "${WAV}"
                                                          "${MP3DEST}"
                                                          --silent -b 16
                                                          -s 9.6 -m m
                                                          --bitwidth 8
                                                          --lowpass 9.6
                                                          --resample 8
                                                          --lowpass-width
                                                          1<span><font
                                                          color="#888888"><br>
                                                          <br>
                                                          --SATISH BAROT<br>
Ahmedabad,India.</font></span>
                                                          <div>
                                                          <div><br>
                                                          <br>
                                                          <div
                                                          class="gmail_quote">On
                                                          Wed, Jan 25,
                                                          2012 at 8:59
                                                          PM, Faraj
                                                          Khasib <span
                                                          dir="ltr">&lt;<a
moz-do-not-send="true" href="mailto:fkhasib@iconnecths.com"
                                                          target="_blank">fkhasib@iconnecths.com</a>&gt;</span>
                                                          wrote:<br>
                                                          <blockquote
                                                          class="gmail_quote"
                                                          style="margin:0px
                                                          0px 0px
                                                          0.8ex;border-left:1px
                                                          solid
                                                          rgb(204,204,204);padding-left:1ex">Hello
                                                          Guys,<br>
                                                          I am trying to
                                                          convert files
                                                          that are .wac
                                                          to mp3 after
                                                          mixmonitor
                                                          command is
                                                          called but it
                                                          doesnt execute
                                                          the command, I
                                                          tried the
                                                          command in
                                                          terminal it
                                                          worked, any
                                                          help please
                                                          ... below is
                                                          my dial plan<br>
                                                          exten=6500,n,Set(MIXMONITOR_EXEC=&amp;&amp;
                                                          nice -n 19
                                                          /usr/local/bin/lame
                                                          -b 8 -t -F -m
                                                          m --bitwidth 8
                                                          --quiet
                                                          "/var/spool/asterisk/monitor/${CALLFILENAME}.wav"
                                                          "/var/spool/asterisk/monitor/${CALLFILENAME}.mp3"
                                                          &amp;&amp; rm
                                                          -f
                                                          "/var/spool/asterisk/monitor/${CALLFILENAME}.wav")<br>
exten=6500,n,MixMonitor(${CALLFILENAME}.wav,b)<br>
                                                          <span></span><br>
                                                          </blockquote>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                        </div>
                                                      </div>
                                                    </blockquote>
                                                  </div>
                                                </div>
                                              </blockquote>
                                            </div>
                                          </div>
                                        </div>
                                        <br>
                                      </blockquote>
                                    </div>
                                    <br>
                                  </div>
                                  <div class="gmail_extra">Show your
                                    latest dialplan and script.<br>
                                    <br>
                                  </div>
                                  <div class="gmail_extra">--Satish
                                    Barot<br>
                                  </div>
                                  <div class="gmail_extra">Ahmedabad,
                                    India<br>
                                  </div>
                                </div>
                                <br>
                              </div>
                            </div>
                            <br>
                          </blockquote>
                        </div>
                      </blockquote>
                    </div>
                    <br>
                  </div>
                </div>
              </div>
              <div class="gmail_extra">Some observations,<br>
              </div>
              <div class="gmail_extra">(1) You are missing ^ in command
                in Mixmonitor.In your case, It should be something like
                MixMonitor(IND_PRI/${CDR(accountcode)}/OUT/${STRFTIME(${EPOCH},,%Y-%m)}/${STRFTIME(${EPOCH},,%d)}/${MIXMONITOR_FILENAME}.wav,m,/root/flac.sh
                ^${MIXMONITOR_FILENAME}.wav) <br>
              </div>
              <div class="gmail_extra">(2) You are passing just file
                name as a parameter in your script and not a full path
                for file. (Do you handle full path in a script?)<span
                  class="HOEnZb"><font color="#888888"><br>
                    <br>
                    <div class="gmail_extra">
                      --Satish Barot<br>
                    </div>
                    Ahmedabad, India<br>
                  </font></span></div>
            </div>
            <br>
            --<br>
_____________________________________________________________________<br>
            -- Bandwidth and Colocation Provided by <a
              moz-do-not-send="true" href="http://www.api-digital.com"
              target="_blank">http://www.api-digital.com</a> --<br>
            New to Asterisk? Join us for a live introductory webinar
            every Thurs:<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a moz-do-not-send="true"
              href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
            <br>
            asterisk-users mailing list<br>
            To UNSUBSCRIBE or update options visit:<br>
            &nbsp; &nbsp;<a moz-do-not-send="true"
              href="http://lists.digium.com/mailman/listinfo/asterisk-users"
              target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by <a class="moz-txt-link-freetext" href="http://www.api-digital.com">http://www.api-digital.com</a> --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               <a class="moz-txt-link-freetext" href="http://www.asterisk.org/hello">http://www.asterisk.org/hello</a>

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   <a class="moz-txt-link-freetext" href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></pre>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <table style="font-family: sans-serif; color: rgb(143, 143, 143);
        font-size: 10px;" cellpadding="3" cellspacing="3">
        <tbody>
          <tr>
            <td style="border-right: 1px solid rgb(191, 191, 191);"> <img
                src="http://www.tecytal.com/imgs/tecytal-logo-email.jpg"
                moz-do-not-send="true"> </td>
            <td> <span style="font-weight: bold; font-size: 1.15em;
                color: rgb(95, 95, 95); line-height: 1.8em;"> Fabio
                Moretti </span> <br>
              <span>Gerente de Sistemas</span> <br>
              <span> <a href="http://www.tecytal.com"
                  style="text-decoration: none; color: rgb(231, 37,
                  25);">www.tecytal.com</a> </span> <br>
              <span> 0800 8780 <br>
                (+598) 248 77921 </span> </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>