<div dir="ltr">Hi John Wilfer,<br><br>Thanks for replay. Now all things is working on asterisk 1.6.2.18 version. But When I try the same thing on Asterisk 1.4.X then facing problem. <br><br>Is this the problem of  ControlPlayback &#39;s option fields of asterisk 1.4.X in this version have option P(jumping) not O(time) ?<br>
Is there any way by which we will implement like by upload ControlPlayback from asterisk 1.6 to 1.4 or else ? <br>ControlPlayback(filename[,skipms[,ff[,rew[,stop[,pause[,restart[,options]]]]]]])<br><br><div class="gmail_quote">
On Sun, Jun 5, 2011 at 2:16 PM, Johan Wilfer <span dir="ltr">&lt;<a href="mailto:lists@jttech.se">lists@jttech.se</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


  
    
    
  
  <div text="#000000" bgcolor="#ffffff"><div class="im">
    On 2011-06-04 13:38, virendra bhati wrote:
    <blockquote type="cite">
      <div dir="ltr">Hi Johan Wilfer,<br>
        <br>
        Thanks for your reply. On the basis of your provided code I made
        all things into extensions.conf. But i have an small issue on
        which I need your attention again.<br>
        in below context what&#39;s  ${tz} ? Is this time zone value or
        else?<br>
      </div>
    </blockquote></div>
    Yes, I store the calls timezone in tis variable before the code
    sample you got.<div class="im"><br>
    <br>
    <blockquote type="cite">
      <div dir="ltr">
        and another things is what is the use of  <span style="color: rgb(0, 102, 0);">SayUnixTime(${time},${tz},d &#39;digits/of&#39; B);</span><br>
        this function in such case?<br>
      </div>
    </blockquote>
    <br></div>
    I&#39;ve implemented 5 as a pause-button on the phone. This context
    handles this by playing a <br>
    prompt that you have pause the recording and &lt;time&gt; and
    &lt;date&gt;.<br>
    <br>
    This is repeated untill the user presses a key on the keypad.<div class="im"><br>
    <blockquote type="cite">
      <div dir="ltr"><br>
        context conference_play_recordings_
        <div bgcolor="#ffffff">
          conference_paused {<br>
              announce =&gt; {<br>
                Set(time=$[${epoch_start}+${position}/1000]);<br>
                while(true) {<br>
                  WaitExten(1);<br>
                  Background(conf_playrec_pause_part1);<br>
                  SayUnixTime(${time},${tz},kM);<br>
                  Background(conf_playrec_pause_part2);<br>
                  SayUnixTime(${time},${tz},d &#39;digits/of&#39; B);<br>
                  Background(conf_playrec_pause_part3);<br>
                  WaitExten(5);<br>
                }<br>
              }</div>
        <br>
        one thing which is also confusing is that what is the meaning or
        use of such lines in this application.<br>
        <br>
        <span style="color: rgb(0, 102, 0);">ControlPlayback(${filename},60000,3,1,*#2456790,,,o(${position}))</span><br>
      </div>
    </blockquote></div>
    ${filename} is the file you want to play.<br>
    60000 is 60 seconds to skip.<br>
    3 is to use 3 as forward 60 seconds<br>
    1 to to use 1 as rewind  60 seconds<br>
    *#2456790 is used as stop buttons (and handled by the dialplan)<br>
    o() is a option to go to a specific position in the file<br>
    ${position} is the variable that hold the current position of the
    playback.<br>
    <br>
    To get more details use the following command:<br>
    asterisk*CLI&gt; core show application ControlPlayback<br>
    <br>
    Displays:<br>
      -= Info about application &#39;ControlPlayback&#39; =- <br>
    <br>
    [Synopsis]<br>
    Play a file with fast forward and rewind. <br>
    <br>
    [Description]<br>
    This application will play back the given &lt;filename&gt;.<br>
    It sets the following channel variables upon completion:<br>
    ${CPLAYBACKSTATUS}: Contains the status of the attempt as a text
    string<br>
        SUCCESS<br>
        USERSTOPPED<br>
        ERROR<br>
    ${CPLAYBACKOFFSET}: Contains the offset in ms into the file where
    playback<br>
    was at when it stopped. &#39;-1&#39; is end of file.<br>
    ${CPLAYBACKSTOPKEY}: If the playback is stopped by the user this
    variable<br>
    contains the key that was pressed.<br>
    <br>
    [Syntax]<br>
ControlPlayback(filename[,skipms[,ff[,rew[,stop[,pause[,restart[,options]]]]]]])<br>
    <br>
    [Arguments]<br>
    skipms<br>
        This is number of milliseconds to skip when rewinding or fast-fo<br>
        rwarding.<br>
    ff<br>
        Fast-forward when this DTMF digit is received. (defaults to &#39;#&#39;)<br>
    rew<br>
        Rewind when this DTMF digit is received. (defaults to &#39;*&#39;)<br>
    stop<br>
        Stop playback when this DTMF digit is received.<br>
    pause<br>
        Pause playback when this DTMF digit is received.<br>
    restart<br>
        Restart playback when this DTMF digit is received.<br>
    options<br>
        o(time): <br>
            time - Start at &lt;time&gt; ms from the beginning of the<br>
            file.<br>
    <br>
    [See Also]<br>
    Not available<br><font color="#888888">
    <br>
    <br>
    /Johan</font><div><div></div><div class="h5"><br>
    <blockquote type="cite">
      <div dir="ltr">
        <br>
        Please put some light on these too.<br>
        <br>
        <div class="gmail_quote">On Wed, Jun 1, 2011 at 1:50 AM, Johan
          Wilfer <span dir="ltr">&lt;<a href="mailto:lists@jttech.se" target="_blank">lists@jttech.se</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
            <div text="#000000" bgcolor="#ffffff">
              <div> On 2011-05-30 14:32, virendra bhati
                wrote:
                <blockquote type="cite">
                  <div dir="ltr">Hi List,<br>
                    <br>
                    Asterisk &#39;s <b>ControlPlayback</b> will used for
                    play any recorded file as an audio player. Is it
                    possible that we can use it for multiple forward and
                    rewind ?<br>
                    <br>
                    ex:-  <br>
                    original:
                    ControlPlayback(filename,skipms,ff,rew,stop,pause) <br>
                    expected
                    ControlPlayback(filename,skip1,skip2,skip3,forward1,rewind1,forward2,rewind2,forward3,rewind3,stop,pause)

                    :  <br>
                  </div>
                </blockquote>
                <br>
              </div>
              Yes, you can use the CPLAYBACKSTATUS, CPLAYBACKOFFSET and
              CPLAYBACKSTOPKEY variables to get this behavior. <br>
              All you have to do is to list the additional keys and stop
              keys and implement this in your dialplan...<br>
              <br>
              I&#39;ve attached some ael I use for this to implement 1 and 3
              as 1 minute rewind/forward. 4 and 6 as 5 minutes
              rewind/forward and 7 and 9 as 15 minutes.<br>
              5 I use as the pause key, and */# to switch recording.<br>
              <br>
              Greetings,<br>
              Johan Wilfer<br>
              <br>
              ----<br>
              <br>
              <br>
                context conference_play_recordings_conference_connect {<br>
                  playrec_intro =&gt; {<br>
                    Set(position=0);<br>
                    goto play,1;<br>
                  }<br>
                  <br>
                  play =&gt; {<br>
                    while (true) {<br>
                      if (${position}==-1) { goto recording_end,1; }<br>
              <br>
                      //rewind 5 seconds after every action (so the user
              doesn&#39;t feel lost...)<br>
                      Set(position=$[${position}-5000]);<br>
                      if (${position} &lt; 0) { Set(position=0); }<br>
                      <br>
                     
              ControlPlayback(${filename},60000,3,1,*#2456790,,,o(${position}));<br>
                      Set(position=${CPLAYBACKOFFSET});<br>
              <br>
                      if (${CPLAYBACKSTATUS}==ERROR) {<br>
                        Playback(pbx_error_500);<br>
                        Playback(pbx_endcall);<br>
                        Wait(2);<br>
                        Hangup();      <br>
                      }        <br>
              <br>
                      //If stopped by user<br>
                      if (${CPLAYBACKSTATUS}==USERSTOPPED) {<br>
                        if (!${ISNULL(${CPLAYBACKSTOPKEY})}) { goto
              ${CPLAYBACKSTOPKEY},1; }<br>
                      }<br>
                    }<br>
                  }<br>
              <br>
                  recording_end =&gt; {<br>
                    //The end of the recording is reached<br>
                    Set(position=0);<br>
                    Background(pbx_endcall);<br>
                    WaitExten(2);<br>
                    Hangup();      <br>
                  }<br>
              <br>
                  1 =&gt; {<br>
                    Set(position=$[${position}-60000]); //Rewind 1
              minute<br>
                    goto play,1;<br>
                  }<br>
                  <br>
                  2 =&gt; {<br>
                    //Instructions, that could be aborted with 2.<br>
                    //1 and 3 could be used to forward/rewind 0 ms
              effectivly disabling the defalut..<br>
                   
              ControlPlayback(conf_playrec_instructions_full,0,1,3,2); <br>
                    Wait(1);<br>
                    goto play,1;     <br>
                  }<br>
                  <br>
                  3 =&gt; {<br>
                    Set(position=$[${position}+60000]); //Forward 1
              minute<br>
                    goto play,1;<br>
                  }<br>
              <br>
                  4 =&gt; {<br>
                    Set(position=$[${position}-300000]); //Rewind 5
              minutes<br>
                    goto play,1;<br>
                  }<br>
                  <br>
                  5 =&gt; {<br>
                    goto conference_play_recordings_conference_paused,
              announce, 1; //Pause<br>
                  }<br>
                  <br>
                  6 =&gt; {<br>
                    Set(position=$[${position}+300000]); //Forward 5
              minutes<br>
                    goto play,1;<br>
                  }<br>
                  <br>
                  7 =&gt; {<br>
                    Set(position=$[${position}-900000]); //Rewind 15
              minutes<br>
                    goto play,1;<br>
                  }<br>
                  <br>
                  9 =&gt; {<br>
                    Set(position=$[${position}+900000]); //Forward 15
              minutes<br>
                    goto play,1;<br>
                  }<br>
                  <br>
                  0 =&gt; {<br>
                    goto playrec_intro,1; //Restart playback of the
              current recording<br>
                  }<br>
                  <br>
                  * =&gt; {<br>
                    //Previous recording<br>
                    //If no recording found, resume playback<br>
                    goto play,1;<br>
                  }<br>
                  <br>
                  # =&gt; {<br>
                    //Next recording<br>
                    //If no recording found, resume playback<br>
                    goto play,1;<br>
                  }<br>
              <br>
                  i =&gt; {<br>
                    goto play,1;<br>
                  }<br>
              <br>
                }<br>
              <br>
                context conference_play_recordings_conference_paused {<br>
                  announce =&gt; {<br>
                    Set(time=$[${epoch_start}+${position}/1000]);<br>
                    while(true) {<br>
                      WaitExten(1);<br>
                      Background(conf_playrec_pause_part1);<br>
                      SayUnixTime(${time},${tz},kM);<br>
                      Background(conf_playrec_pause_part2);<br>
                      SayUnixTime(${time},${tz},d &#39;digits/of&#39; B);<br>
                      Background(conf_playrec_pause_part3);<br>
                      WaitExten(5);<br>
                    }<br>
                  }<br>
              <br>
                  i =&gt; {<br>
                    //Every inputs goes here<br>
                    Wait(1);<br>
                    goto
              conference_play_recordings_conference_connect,play,1;<br>
                  }<br>
                }<br>
              <br>
              <br>
              <blockquote type="cite">
                <div>
                  <div dir="ltr">     <br>
                    <div dir="ltr"><br>
                      -----<br>
                      Thanks and regards<br>
                      <br>
                       Virendra Bhati<br>
                      +91-9172341457<br>
                      Asterisk Engineer<br>
                    </div>
                    <br>
                  </div>
                </div>
                <pre><fieldset></fieldset>
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a>

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a></pre>
              </blockquote>
              <br>
              <br>
              <pre cols="72">-- 
Med vänlig hälsning

Johan Wilfer                 email: <a href="mailto:johan@jttech.se" target="_blank">johan@jttech.se</a>
JT Tech | Utvecklare         webb: <a href="http://jttech.se" target="_blank">http://jttech.se</a>
direkt: +46 31 380 91 01  support: +46 31 380 91 00
</pre>
            </div>
            <br>
            --<br>
_____________________________________________________________________<br>
            -- Bandwidth and Colocation Provided by <a 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>
                          <a 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>
              <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        <div dir="ltr"><br>
          <br>
          <br>
          -----<br>
          Thanks and regards<br>
          <br>
           Virendra Bhati<br>
          +91-9172341457<br>
          Asterisk Engineer<br>
        </div>
        <br>
      </div>
      <pre><fieldset></fieldset>
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a>

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a></pre>
    </blockquote>
    <br>
    <br>
    <pre cols="72">-- 
Med vänlig hälsning

Johan Wilfer                 email: <a href="mailto:johan@jttech.se" target="_blank">johan@jttech.se</a>
JT Tech | Utvecklare         webb: <a href="http://jttech.se" target="_blank">http://jttech.se</a>
direkt: +46 31 380 91 01  support: +46 31 380 91 00
</pre>
  </div></div></div>

<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a 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>
               <a 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>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><br><br>
<br>-----<br>Thanks and regards<br><br> Virendra Bhati<br>+91-9172341457<br>Asterisk Engineer<br></div><br>
</div>