@ -739,19 +739,13 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
for ( x = 0 ; x < fmtcnt ; x + + ) {
for ( x = 0 ; x < fmtcnt ; x + + ) {
if ( ! others [ x ] )
if ( ! others [ x ] )
break ;
break ;
if ( res > 0 ) {
if ( res > 0 )
if ( totalsilence )
ast_stream_rewind ( others [ x ] , totalsilence ? totalsilence - 200 : 200 ) ;
ast_stream_rewind ( others [ x ] , totalsilence - 200 ) ;
else
ast_stream_rewind ( others [ x ] , 200 ) ;
}
ast_truncstream ( others [ x ] ) ;
ast_truncstream ( others [ x ] ) ;
ast_closestream ( others [ x ] ) ;
ast_closestream ( others [ x ] ) ;
}
}
if ( rfmt ) {
if ( rfmt & & ast_set_read_format ( chan , rfmt ) ) {
if ( ast_set_read_format ( chan , rfmt ) ) {
ast_log ( LOG_WARNING , " Unable to restore format %s to channel '%s' \n " , ast_getformatname ( rfmt ) , chan - > name ) ;
ast_log ( LOG_WARNING , " Unable to restore format %s to channel '%s' \n " , ast_getformatname ( rfmt ) , chan - > name ) ;
}
}
}
if ( outmsg > 1 ) {
if ( outmsg > 1 ) {
/* Let them know recording is stopped */
/* Let them know recording is stopped */
@ -982,17 +976,13 @@ int ast_play_and_prepend(struct ast_channel *chan, char *playfile, char *recordf
ast_filedelete ( prependfile , sfmt [ x ] ) ;
ast_filedelete ( prependfile , sfmt [ x ] ) ;
}
}
}
}
if ( rfmt ) {
if ( rfmt & & ast_set_read_format ( chan , rfmt ) ) {
if ( ast_set_read_format ( chan , rfmt ) ) {
ast_log ( LOG_WARNING , " Unable to restore format %s to channel '%s' \n " , ast_getformatname ( rfmt ) , chan - > name ) ;
ast_log ( LOG_WARNING , " Unable to restore format %s to channel '%s' \n " , ast_getformatname ( rfmt ) , chan - > name ) ;
}
}
}
if ( outmsg ) {
if ( outmsg > 1 ) {
if ( outmsg > 1 ) {
/* Let them know it worked */
/* Let them know it worked */
ast_streamfile ( chan , " auth-thankyou " , chan - > language ) ;
ast_streamfile ( chan , " auth-thankyou " , chan - > language ) ;
ast_waitstream ( chan , " " ) ;
ast_waitstream ( chan , " " ) ;
}
}
}
return res ;
return res ;
}
}