add changes for sounds download to allow independent version specific selection

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15777 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Jeff Lenk 2009-12-03 19:43:38 +00:00
parent 718671a30d
commit 05cc65b2e8
6 changed files with 30 additions and 8 deletions

View File

@ -16,10 +16,11 @@ DEFAULT_SOUNDS=en-us-callie-8000
@target=`echo $@ | sed -e 's|^.*-||'`; \ @target=`echo $@ | sed -e 's|^.*-||'`; \
target_prefix=`echo $@ | sed -e 's|-.*$$||'`; \ target_prefix=`echo $@ | sed -e 's|-.*$$||'`; \
sound_perfix=`echo $@ | sed -e 's|-.*||'`; \ sound_perfix=`echo $@ | sed -e 's|-.*||'`; \
sounds_version=`cat $(switch_srcdir)/build/sounds_version.txt`;\
moh_version=`cat $(switch_srcdir)/build/moh_version.txt`;\ moh_version=`cat $(switch_srcdir)/build/moh_version.txt`;\
full_sound_dir=`echo $@ | sed -e 's|^sounds||' | sed -e 's|^-||' | sed -e 's|-install$$||'`; \ full_sound_dir=`echo $@ | sed -e 's|^sounds||' | sed -e 's|^-||' | sed -e 's|-install$$||'`; \
test ! -z $$full_sound_dir || full_sound_dir=`echo $(DEFAULT_SOUNDS)`; \ test ! -z $$full_sound_dir || full_sound_dir=`echo $(DEFAULT_SOUNDS)`; \
base_sound_dir=`echo $$full_sound_dir | sed -e 's|-[^-]*000$$||' ` ;\
sounds_version=`grep $$base_sound_dir $(switch_srcdir)/build/sounds_version.txt | cut -d ' ' -f2`;\
soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$moh_version.tar.gz`; \ soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$moh_version.tar.gz`; \
echo $$full_sound_dir | grep music >/dev/null || soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$sounds_version.tar.gz`; \ echo $$full_sound_dir | grep music >/dev/null || soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$sounds_version.tar.gz`; \
if test "$$target" = "install"; then $(MAKE) $(AM_MAKEFLAGS) core_install; else $(MAKE) $(AM_MAKEFLAGS) core ; fi; \ if test "$$target" = "install"; then $(MAKE) $(AM_MAKEFLAGS) core_install; else $(MAKE) $(AM_MAKEFLAGS) core ; fi; \

View File

@ -1 +1,3 @@
1.0.12 en-us-callie 1.0.12
ru-RU-elena 1.0.12

View File

@ -75,7 +75,7 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Downloading 32khzsound." Description="Downloading 32khzsound."
CommandLine="set /P SOUND_VERSION=&lt;$(ProjectDir)..\..\build\sounds_version.txt&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\32000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-32000-%SOUND_VERSION%.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;" CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\32000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzipSounds en-us-callie 32000 &quot;$(ProjectDir)..\sounds&quot; &quot;$(ProjectDir)..\..\build\sounds_version.txt&quot;"
Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\32000" Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\32000"
/> />
</FileConfiguration> </FileConfiguration>
@ -85,7 +85,7 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Downloading 32khzsound." Description="Downloading 32khzsound."
CommandLine="set /P SOUND_VERSION=&lt;$(ProjectDir)..\..\build\sounds_version.txt&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\32000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-32000-%SOUND_VERSION%.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;" CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\32000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzipSounds en-us-callie 32000 &quot;$(ProjectDir)..\sounds&quot; &quot;$(ProjectDir)..\..\build\sounds_version.txt&quot;"
Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\32000" Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\32000"
/> />
</FileConfiguration> </FileConfiguration>

View File

@ -75,7 +75,7 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Downloading 16khzsound." Description="Downloading 16khzsound."
CommandLine="set /P SOUND_VERSION=&lt;$(ProjectDir)..\..\build\sounds_version.txt&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\16000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-16000-%SOUND_VERSION%.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;" CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\16000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzipSounds en-us-callie 16000 &quot;$(ProjectDir)..\sounds&quot; &quot;$(ProjectDir)..\..\build\sounds_version.txt&quot;"
Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\16000" Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\16000"
/> />
</FileConfiguration> </FileConfiguration>
@ -85,7 +85,7 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Downloading 16khzsound." Description="Downloading 16khzsound."
CommandLine="set /P SOUND_VERSION=&lt;$(ProjectDir)..\..\build\sounds_version.txt&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\16000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-16000-%SOUND_VERSION%.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;" CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\16000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzipSounds en-us-callie 16000 &quot;$(ProjectDir)..\sounds&quot; &quot;$(ProjectDir)..\..\build\sounds_version.txt&quot;"
Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\16000" Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\16000"
/> />
</FileConfiguration> </FileConfiguration>

View File

@ -75,7 +75,7 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Downloading 8khzsound." Description="Downloading 8khzsound."
CommandLine="set /P SOUND_VERSION=&lt;$(ProjectDir)..\..\build\sounds_version.txt&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\8000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-8000-%SOUND_VERSION%.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;" CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\8000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzipSounds en-us-callie 8000 &quot;$(ProjectDir)..\sounds&quot; &quot;$(ProjectDir)..\..\build\sounds_version.txt&quot;"
Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\8000" Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\8000"
/> />
</FileConfiguration> </FileConfiguration>
@ -85,7 +85,7 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Downloading 8khzsound." Description="Downloading 8khzsound."
CommandLine="set /P SOUND_VERSION=&lt;$(ProjectDir)..\..\build\sounds_version.txt&#x0D;&#x0A;if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\8000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzip http://files.freeswitch.org/freeswitch-sounds-en-us-callie-8000-%SOUND_VERSION%.tar.gz &quot;$(ProjectDir)..\sounds&quot;&#x0D;&#x0A;" CommandLine="if not exist &quot;$(ProjectDir)..\sounds\en\us\callie\voicemail\8000&quot; cscript /nologo &quot;$(ProjectDir)util.vbs&quot; GetUnzipSounds en-us-callie 8000 &quot;$(ProjectDir)..\sounds&quot; &quot;$(ProjectDir)..\..\build\sounds_version.txt&quot;"
Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\8000" Outputs="$(ProjectDir)..\sounds\en\us\callie\voicemail\8000"
/> />
</FileConfiguration> </FileConfiguration>

View File

@ -45,6 +45,8 @@ If objArgs.Count >=3 Then
Wget objArgs(1), Showpath(objArgs(2)) Wget objArgs(1), Showpath(objArgs(2))
Case "GetUnzip" Case "GetUnzip"
WgetUnCompress objArgs(1), Showpath(objArgs(2)) WgetUnCompress objArgs(1), Showpath(objArgs(2))
Case "GetUnzipSounds"
WgetSounds objArgs(1), objArgs(2), Showpath(objArgs(3)), objArgs(4)
Case "Version" Case "Version"
'CreateVersion(tmpFolder, VersionDir, includebase, includedest) 'CreateVersion(tmpFolder, VersionDir, includebase, includedest)
CreateVersion Showpath(objArgs(1)), Showpath(objArgs(2)), objArgs(3), objArgs(4) CreateVersion Showpath(objArgs(1)), Showpath(objArgs(2)), objArgs(3), objArgs(4)
@ -56,6 +58,23 @@ End If
' Utility Subroutines ' Utility Subroutines
' ******************* ' *******************
Sub WgetSounds(PrimaryName, Freq, DestFolder, VersionFile)
BaseURL = "http://files.freeswitch.org/freeswitch-sounds"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(VersionFile,1)
Do Until objTextFile.AtEndOfStream
strLine = objTextFile.Readline
versionPos = InstrRev(strLine, " ", -1, 1)
name = Left(strLine, versionPos-1)
if name = PrimaryName Then
version = Right(strLine, Len(strLine) - versionPos)
Wscript.Echo "Sound name: " & name & " Version " & version
URL = BaseURL & "-" & name & "-" & Freq &"-" & version & ".tar.gz"
Wscript.Echo "URL: " & URL
WgetUnCompress URL, Showpath(DestFolder)
End If
Loop
End Sub
Sub WgetUnCompress(URL, DestFolder) Sub WgetUnCompress(URL, DestFolder)
If Right(DestFolder, 1) <> "\" Then DestFolder = DestFolder & "\" End If If Right(DestFolder, 1) <> "\" Then DestFolder = DestFolder & "\" End If