Revision
15777
Author
jlenk
Date
2009-12-03 13:43:38 -0600 (Thu, 03 Dec 2009)

Log Message

add changes for sounds download to allow independent version specific selection

Modified Paths

Diff

Modified: freeswitch/trunk/Makefile.am (15776 => 15777)


--- freeswitch/trunk/Makefile.am	2009-12-03 18:19:30 UTC (rev 15776)
+++ freeswitch/trunk/Makefile.am	2009-12-03 19:43:38 UTC (rev 15777)
@@ -16,10 +16,11 @@
 	@target=`echo $@ | sed -e 's|^.*-||'`; \
 	 target_prefix=`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`;\
 	 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)`; \
+	 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`; \
 	 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; \

Modified: freeswitch/trunk/build/sounds_version.txt (15776 => 15777)


--- freeswitch/trunk/build/sounds_version.txt	2009-12-03 18:19:30 UTC (rev 15776)
+++ freeswitch/trunk/build/sounds_version.txt	2009-12-03 19:43:38 UTC (rev 15777)
@@ -1 +1,3 @@
-1.0.12
+en-us-callie 1.0.12
+ru-RU-elena 1.0.12
+

Modified: freeswitch/trunk/libs/win32/Dowload 32khz Sounds.2008.vcproj (15776 => 15777)


--- freeswitch/trunk/libs/win32/Dowload 32khz Sounds.2008.vcproj	2009-12-03 18:19:30 UTC (rev 15776)
+++ freeswitch/trunk/libs/win32/Dowload 32khz Sounds.2008.vcproj	2009-12-03 19:43:38 UTC (rev 15777)
@@ -75,7 +75,7 @@
 				<Tool
 					Name="VCCustomBuildTool"
 					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"
 				/>
 			</FileConfiguration>
@@ -85,7 +85,7 @@
 				<Tool
 					Name="VCCustomBuildTool"
 					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"
 				/>
 			</FileConfiguration>

Modified: freeswitch/trunk/libs/win32/Download 16khz Sounds.2008.vcproj (15776 => 15777)


--- freeswitch/trunk/libs/win32/Download 16khz Sounds.2008.vcproj	2009-12-03 18:19:30 UTC (rev 15776)
+++ freeswitch/trunk/libs/win32/Download 16khz Sounds.2008.vcproj	2009-12-03 19:43:38 UTC (rev 15777)
@@ -75,7 +75,7 @@
 				<Tool
 					Name="VCCustomBuildTool"
 					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"
 				/>
 			</FileConfiguration>
@@ -85,7 +85,7 @@
 				<Tool
 					Name="VCCustomBuildTool"
 					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"
 				/>
 			</FileConfiguration>

Modified: freeswitch/trunk/libs/win32/Download 8khz Sounds.2008.vcproj (15776 => 15777)


--- freeswitch/trunk/libs/win32/Download 8khz Sounds.2008.vcproj	2009-12-03 18:19:30 UTC (rev 15776)
+++ freeswitch/trunk/libs/win32/Download 8khz Sounds.2008.vcproj	2009-12-03 19:43:38 UTC (rev 15777)
@@ -75,7 +75,7 @@
 				<Tool
 					Name="VCCustomBuildTool"
 					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"
 				/>
 			</FileConfiguration>
@@ -85,7 +85,7 @@
 				<Tool
 					Name="VCCustomBuildTool"
 					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"
 				/>
 			</FileConfiguration>

Modified: freeswitch/trunk/libs/win32/util.vbs (15776 => 15777)


--- freeswitch/trunk/libs/win32/util.vbs	2009-12-03 18:19:30 UTC (rev 15776)
+++ freeswitch/trunk/libs/win32/util.vbs	2009-12-03 19:43:38 UTC (rev 15777)
@@ -45,6 +45,8 @@
 			Wget objArgs(1), Showpath(objArgs(2))
 		Case "GetUnzip"		
 			WgetUnCompress objArgs(1), Showpath(objArgs(2))
+		Case "GetUnzipSounds"
+			WgetSounds objArgs(1), objArgs(2), Showpath(objArgs(3)), objArgs(4)
 		Case "Version"					
 			'CreateVersion(tmpFolder, VersionDir, includebase, includedest)
 			CreateVersion Showpath(objArgs(1)), Showpath(objArgs(2)), objArgs(3), objArgs(4)
@@ -56,6 +58,23 @@
 ' 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)
 	If Right(DestFolder, 1) <> "\" Then DestFolder = DestFolder & "\" End If