[asterisk-dev] Control payback bookmarks

Julian Lyndon-Smith asterisk at dotr.com
Mon Mar 16 06:11:04 CDT 2009


We have had a request from one of our users to be able to jump to 
certain parts of a file during playback.

For example, during a 10 minute conversation , there are certain actions 
taken by the agent. My user wants to be able to jump to the point around 
these actions, without having to constantly press ffwd.

I have looked at app_controlplayback.c and I think I've figured out what 
to do but wanted to run it past the "real" developers ;)

Add an option to ControlPlayBack called B, where B specifies the number 
of seconds for each bookmark, i.e.

B(60,180,300)

Would be a bookmark at 60, 180 and 300 seconds. In order to allow 
someone to loop through the bookmarks, another 2 keys need to be 
defined. In order not to break dialplans, I was going to add them as the 
first two parameters to the B option

B(7,9,60,180,300)  (7 = prev bookmark, 9 = next bookmark).

I think then that I need to modify ast_control_streamfile in app.c to 
take the additional parameters, and then ast_waitstream_fr in file.c to 
take the additional parameters.

Also in file.c I need to add

int ast_stream_startatpos(struct ast_filestream *fs, off_t ms)
{
    return ast_seekstream(fs, ms * DEFAULT_SAMPLES_PER_MS, 0);
}

In ast_waitstream_core, I need to check for the two new keys and loop 
through the bookmarks, calling ast_stream_startatpos with the 
appropriate bookmark, converted to milliseconds.

Am I way off the mark, or generally ok with this approach ?

All comments welcome ;)

Julian






______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________



More information about the asterisk-dev mailing list