sksushilkumar / red5phone

Automatically exported from code.google.com/p/red5phone
0 stars 0 forks source link

Asao2Ulaw assumes .exe on linux #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Asao2Ulaw.java does an OS check, however, on both Linux and Windows it
assumes the program will end in .exe:

if (OS.indexOf("windows") > -1) {
                                command[0] = appPath +
"/webapps/sip/assets/codecs/asao2ulaw.exe";

                        } else { // we assue linux
                                command[0] = appPath +
"/webapps/sip/assets/codecs/asao2ulaw.exe";
                        }

The source should be updated to not include .exe when the OS is not windows.

Original issue reported on code.google.com by mgam...@gmail.com on 30 May 2008 at 3:10

GoogleCodeExporter commented 9 years ago
And the "cut off a magic number of characters from the path" trick seems 
unnecessary
too. (on linux)

Index: org/red5/server/webapp/sip/Asao2Ulaw.java
===================================================================
--- org/red5/server/webapp/sip/Asao2Ulaw.java   (revision 3)
+++ org/red5/server/webapp/sip/Asao2Ulaw.java   (working copy)
@@ -32,7 +32,7 @@

                        String[] command = {""};
                        String appPath = System.getProperty("user.dir");
-                       appPath = appPath.substring(0, (appPath.length() - 8)); 
 //
removing /wrapper from path name
+                       //appPath = appPath.substring(0, (appPath.length() - 
8));  //
removing /wrapper from path name

                        String OS = System.getProperty("os.name").toLowerCase();

@@ -40,7 +40,7 @@
                                command[0] = appPath +
"/webapps/sip/assets/codecs/asao2ulaw.exe";

                        } else { // we assue linux
-                               command[0] = appPath +
"/webapps/sip/assets/codecs/asao2ulaw.exe";
+                               command[0] = appPath +
"/webapps/sip/assets/codecs/asao2ulaw";
                        }

                        asaoProcess = Runtime.getRuntime().exec(command);

Original comment by szoc...@gmail.com on 30 Jul 2008 at 11:47