@ -1170,7 +1170,7 @@ static int do_timelimit(struct ast_channel *chan, struct ast_bridge_config *conf
play_to_caller = 1 ;
play_to_caller = 1 ;
var = pbx_builtin_getvar_helper ( chan , " LIMIT_WARNING_FILE " ) ;
var = pbx_builtin_getvar_helper ( chan , " LIMIT_WARNING_FILE " ) ;
config - > warning_sound = ! ast_strlen_zero ( var ) ? ast_strdup a ( var ) : " timeleft " ;
config - > warning_sound = ! ast_strlen_zero ( var ) ? ast_strdup ( var ) : ast_strdup ( " timeleft " ) ;
/* The code looking at config wants a NULL, not just "", to decide
/* The code looking at config wants a NULL, not just "", to decide
* that the message should not be played , so we replace " " with NULL .
* that the message should not be played , so we replace " " with NULL .
@ -1179,10 +1179,10 @@ static int do_timelimit(struct ast_channel *chan, struct ast_bridge_config *conf
*/
*/
var = pbx_builtin_getvar_helper ( chan , " LIMIT_TIMEOUT_FILE " ) ;
var = pbx_builtin_getvar_helper ( chan , " LIMIT_TIMEOUT_FILE " ) ;
config - > end_sound = ! ast_strlen_zero ( var ) ? ast_strdup a ( var ) : NULL ;
config - > end_sound = ! ast_strlen_zero ( var ) ? ast_strdup ( var ) : NULL ;
var = pbx_builtin_getvar_helper ( chan , " LIMIT_CONNECT_FILE " ) ;
var = pbx_builtin_getvar_helper ( chan , " LIMIT_CONNECT_FILE " ) ;
config - > start_sound = ! ast_strlen_zero ( var ) ? ast_strdup a ( var ) : NULL ;
config - > start_sound = ! ast_strlen_zero ( var ) ? ast_strdup ( var ) : NULL ;
ast_channel_unlock ( chan ) ;
ast_channel_unlock ( chan ) ;
@ -2264,6 +2264,15 @@ out:
}
}
done :
done :
if ( config . warning_sound ) {
ast_free ( ( char * ) config . warning_sound ) ;
}
if ( config . end_sound ) {
ast_free ( ( char * ) config . end_sound ) ;
}
if ( config . start_sound ) {
ast_free ( ( char * ) config . start_sound ) ;
}
return res ;
return res ;
}
}