[asterisk-commits] twilson: trunk r346033 - in /trunk: ./ res/res_musiconhold.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Nov 23 10:12:39 CST 2011
Author: twilson
Date: Wed Nov 23 10:12:34 2011
New Revision: 346033
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=346033
Log:
Resume playing existing hold music for cached realtime MOH
As a result of the fix for ASTERISK-18039, realtime caching MOH no longer
properly resumes playing back a file between different holds in the same call.
This is because scanning for new files causes the existing file array to be
emptied and we were just comparing that the saved pointer to the filename
matched the pointer to the filename in a particular position in the array. An
easy fix is to save the filename instead of a pointer to it and then do a
strcmp instead of comparing the addresses.
(closes issue ASTERISK-18912)
Review: https://reviewboard.asterisk.org/r/1596/
........
Merged revisions 346030 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 346031 from http://svn.asterisk.org/svn/asterisk/branches/10
Modified:
trunk/ (props changed)
trunk/res/res_musiconhold.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.
Modified: trunk/res/res_musiconhold.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_musiconhold.c?view=diff&rev=346033&r1=346032&r2=346033
==============================================================================
--- trunk/res/res_musiconhold.c (original)
+++ trunk/res/res_musiconhold.c Wed Nov 23 10:12:34 2011
@@ -163,7 +163,7 @@
int pos;
int save_pos;
int save_total;
- char *save_pos_filename;
+ char save_pos_filename[PATH_MAX];
};
#define MOH_QUIET (1 << 0)
@@ -298,10 +298,10 @@
return -1;
}
- if (state->pos == 0 && state->save_pos_filename == NULL) {
+ if (state->pos == 0 && ast_strlen_zero(state->save_pos_filename)) {
/* First time so lets play the file. */
state->save_pos = -1;
- } else if (state->save_pos >= 0 && state->save_pos < state->class->total_files && state->class->filearray[state->save_pos] == state->save_pos_filename) {
+ } else if (state->save_pos >= 0 && state->save_pos < state->class->total_files && !strcmp(state->class->filearray[state->save_pos], state->save_pos_filename)) {
/* If a specific file has been saved confirm it still exists and that it is still valid */
state->pos = state->save_pos;
state->save_pos = -1;
@@ -338,7 +338,7 @@
}
/* Record the pointer to the filename for position resuming later */
- state->save_pos_filename = state->class->filearray[state->pos];
+ ast_copy_string(state->save_pos_filename, state->class->filearray[state->pos], sizeof(state->save_pos_filename));
ast_debug(1, "%s Opened file %d '%s'\n", chan->name, state->pos, state->class->filearray[state->pos]);
More information about the asterisk-commits
mailing list