FS-5160 --resolve This is depricated in favor of {loops=10}tone_stream://path=/foo/bar.ttml adding legacy code to let both ways work

This commit is contained in:
Anthony Minessale 2013-03-09 07:58:09 -06:00
parent 1d289b3617
commit e942571876
2 changed files with 11 additions and 2 deletions

View File

@ -695,14 +695,14 @@
<extension name="milliwatt">
<condition field="destination_number" expression="^9197$">
<action application="answer"/>
<action application="playback" data="tone_stream://%(251,0,1004);loops=-1"/>
<action application="playback" data="{loops=-1}tone_stream://%(251,0,1004)"/>
</condition>
</extension>
<extension name="tone_stream">
<condition field="destination_number" expression="^9198$">
<action application="answer"/>
<action application="playback" data="tone_stream://path=${base_dir}/conf/tetris.ttml;loops=10"/>
<action application="playback" data="{loops=10}tone_stream://path=${base_dir}/conf/tetris.ttml"/>
</condition>
</extension>

View File

@ -136,6 +136,15 @@ static switch_status_t tone_stream_file_open(switch_file_handle_t *handle, const
switch_buffer_create_dynamic(&audio_buffer, 1024, 1024, 0);
switch_assert(audio_buffer);
if ((tmp = (char *)switch_stristr(";loops=", tonespec))) {
*tmp = '\0';
tmp += 7;
if (tmp) {
loops = atoi(tmp);
switch_buffer_set_loops(audio_buffer, loops);
}
}
if (handle->params) {
if ((tmp = switch_event_get_header(handle->params, "loops"))) {
loops = atoi(tmp);