@ -155,13 +155,19 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
< para > Defaults to < literal > # < / literal > < / para >
< / parameter >
< parameter name = " pausechr " / >
< parameter name = " offsetms " >
< para > Offset , in milliseconds , to start the audio playback < / para >
< / parameter >
< / syntax >
< description >
< para > Send the given file , allowing playback to be controlled by the given
digits , if any . Use double quotes for the digits if you wish none to be
permitted . Returns < literal > 0 < / literal > if playback completes without a digit
permitted . If offsetms is provided then the audio will seek to offsetms
before play starts . Returns < literal > 0 < / literal > if playback completes without a digit
being pressed , or the ASCII numerical value of the digit if one was pressed ,
or < literal > - 1 < / literal > on error or if the channel was disconnected . < / para >
or < literal > - 1 < / literal > on error or if the channel was disconnected . Returns the
position where playback was terminated as endpos . < / para >
< para > It sets the following channel variables upon completion : < / para >
< variablelist >
< variable name = " CPLAYBACKSTATUS " >
@ -2092,7 +2098,7 @@ static int handle_controlstreamfile(struct ast_channel *chan, AGI *agi, int argc
long offsetms = 0 ;
char offsetbuf [ 20 ] ;
if ( argc < 5 | | argc > 9 ) {
if ( argc < 5 | | argc > 10 ) {
return RESULT_SHOWUSAGE ;
}
@ -2116,7 +2122,11 @@ static int handle_controlstreamfile(struct ast_channel *chan, AGI *agi, int argc
suspend = argv [ 8 ] ;
}
res = ast_control_streamfile ( chan , argv [ 3 ] , fwd , rev , stop , suspend , NULL , skipms , NULL ) ;
if ( argc > 9 & & ( sscanf ( argv [ 9 ] , " %30ld " , & offsetms ) ! = 1 ) ) {
return RESULT_SHOWUSAGE ;
}
res = ast_control_streamfile ( chan , argv [ 3 ] , fwd , rev , stop , suspend , NULL , skipms , & offsetms ) ;
/* If we stopped on one of our stop keys, return 0 */
if ( res > 0 & & stop & & strchr ( stop , res ) ) {
@ -2137,7 +2147,7 @@ static int handle_controlstreamfile(struct ast_channel *chan, AGI *agi, int argc
snprintf ( offsetbuf , sizeof ( offsetbuf ) , " %ld " , offsetms ) ;
pbx_builtin_setvar_helper ( chan , " CPLAYBACKOFFSET " , offsetbuf ) ;
ast_agi_send ( agi - > fd , chan , " 200 result=%d \n " , re s) ;
ast_agi_send ( agi - > fd , chan , " 200 result=%d endpos=%ld \n " , re s, offsetm s) ;
return ( res > = 0 ) ? RESULT_SUCCESS : RESULT_FAILURE ;
}