Commit e1c2a383 authored by smorlat's avatar smorlat

Merge branch 'wince-port'

Conflicts:
	linphone/coreapi/exevents.c
	linphone/coreapi/friend.c
	linphone/coreapi/linphonecore.c
	linphone/coreapi/lpconfig.c
	linphone/mediastreamer2/build/wince/mediastreamer2.def
	linphone/mediastreamer2/build/wince/mediastreamer2.vcproj
	linphone/mediastreamer2/src/msvolume.c
	linphone/oRTP/build/wince/oRTP.vcproj
	linphone/oRTP/src/rtpsession.c

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@801 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parents a25dde87 fd0c5550

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblinphone", "liblinphone.vcproj", "{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "linphonec", "linphonec\linphonec.vcproj", "{92574924-BF59-4DAA-994B-9978B80E5797}"
ProjectSection(ProjectDependencies) = postProject
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7} = {290078F0-3B63-47BF-A2A9-E1AF5411F5E7}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
Debug|Windows Mobile 6 Standard SDK (ARMV4I) = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
Release|Win32 = Release|Win32
Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I)
Release|Windows Mobile 6 Standard SDK (ARMV4I) = Release|Windows Mobile 6 Standard SDK (ARMV4I)
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Debug|Win32.ActiveCfg = Debug|Win32
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Debug|Win32.Build.0 = Debug|Win32
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Release|Win32.ActiveCfg = Release|Win32
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Release|Win32.Build.0 = Release|Win32
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Standard SDK (ARMV4I)
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I)
{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I)
{92574924-BF59-4DAA-994B-9978B80E5797}.Debug|Win32.ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{92574924-BF59-4DAA-994B-9978B80E5797}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{92574924-BF59-4DAA-994B-9978B80E5797}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{92574924-BF59-4DAA-994B-9978B80E5797}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{92574924-BF59-4DAA-994B-9978B80E5797}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{92574924-BF59-4DAA-994B-9978B80E5797}.Release|Win32.ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{92574924-BF59-4DAA-994B-9978B80E5797}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{92574924-BF59-4DAA-994B-9978B80E5797}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{92574924-BF59-4DAA-994B-9978B80E5797}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{92574924-BF59-4DAA-994B-9978B80E5797}.Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
This diff is collapsed.
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="linphonec"
ProjectGUID="{92574924-BF59-4DAA-994B-9978B80E5797}"
RootNamespace="linphonec"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Windows Mobile 6 Professional SDK (ARMV4I)"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
Optimization="0"
AdditionalIncludeDirectories="&quot;..\..\..\..\..\linphone-builder\osip\include&quot;;..\..\..\mediastreamer2\include;..\..\..\oRTP\include;..\..\..\coreapi"
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;IN_LINPHONE"
MinimalRebuild="true"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /subsystem:windowsce,5.02"
AdditionalDependencies="mediastreamer2.lib ortp.lib liblinphone.lib ws2.lib mmtimer.lib iphlpapi.lib eXosip2.lib osip2.lib osipparser2.lib"
OutputFile="$(OutDir)/linphonec.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;..\..\..\oRTP\build\wince\$(PlatformName)\$(ConfigurationName)&quot;;&quot;..\..\..\mediastreamer2\build\wince\$(PlatformName)\$(ConfigurationName)&quot;;&quot;..\$(PlatformName)\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\linphone-builder\eXosip\platform\wince\$(PlatformName)\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\linphone-builder\osip\platform\wince\$(PlatformName)\$(ConfigurationName)&quot;"
DelayLoadDLLs="$(NOINHERIT)"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/linphonec.pdb"
SubSystem="0"
StackReserveSize="65536"
StackCommitSize="4096"
EntryPointSymbol="mainWCRTStartup"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="%CSIDL_PROGRAM_FILES%\linphone"
RegisterOutput="0"
AdditionalFiles="..\..\..\oRTP\build\wince\$(PlatformName)\$(ConfigurationName)\oRTP.dll;..\..\..\mediastreamer2\build\wince\$(PlatformName)\$(ConfigurationName)\mediastreamer2.dll"
/>
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
Optimization="2"
FavorSizeOrSpeed="2"
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /subsystem:windowsce,5.02"
OutputFile="$(OutDir)/linphonec.exe"
LinkIncremental="1"
DelayLoadDLLs="$(NOINHERIT)"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/linphonec.pdb"
SubSystem="0"
StackReserveSize="65536"
StackCommitSize="4096"
OptimizeReferences="2"
EnableCOMDATFolding="2"
EntryPointSymbol="mainWCRTStartup"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory=""
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\..\console\commands.c"
>
</File>
<File
RelativePath="..\..\..\console\linphonec.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\..\console\linphonec.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
......@@ -36,8 +36,15 @@ AC_HEADER_STDC
AM_PROG_CC_C_O
case $target_os in
*mingw32ce)
CFLAGS="$CFLAGS -D_WIN32_WCE -DORTP_STATIC -D_WIN32_WINNT=0x0501"
CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
LIBS="$LIBS -lws2 -liphlpapi"
mingw_found=yes
mingwce_found=yes
;;
*mingw*)
CFLAGS="$CFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
CFLAGS="$CFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501 "
CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
LIBS="$LIBS -lws2_32"
GUI_FLAGS="-mwindows"
......@@ -84,9 +91,15 @@ dnl gettext macro does not work properly under mingw.
AM_GNU_GETTEXT([external])
LIBS="$LIBS $LIBINTL"
else
AC_DEFINE(ENABLE_NLS,1,[Tells whether localisation is possible])
AC_DEFINE(HAVE_GETTEXT,1,[Tells wheter localisation is possible])
LIBS="$LIBS -L/usr/lib -lintl"
if test "$mingwce_found" != "yes" ; then
AC_DEFINE(ENABLE_NLS,1,[Tells whether localisation is possible])
AC_DEFINE(HAVE_GETTEXT,1,[Tells wheter localisation is possible])
LIBS="$LIBS -L/usr/lib -lintl"
else
dnl gettext macro does not work properly under mingw.
AM_GNU_GETTEXT([external])
LIBS="$LIBS $LIBINTL"
fi
fi
GETTEXT_PACKAGE=linphone
......@@ -315,6 +328,19 @@ dnl compilation of gtk-glade user interface
AM_CONDITIONAL(BUILD_GLADE_UI, [test x$gtk_ui = xtrue ] )
AM_CONDITIONAL(BUILD_WIN32, test x$mingw_found = xyes )
dnl check getenv
AH_TEMPLATE([HAVE_GETENV])
AC_CHECK_FUNC([getenv], AC_DEFINE([HAVE_GETENV], [1], [If present, the getenv function allows fim to read environment variables.]))
dnl
AC_MSG_CHECKING([for sighandler_t])
AC_TRY_COMPILE([#include <signal.h>],[sighandler_t *f;],
has_sighandler_t=yes,has_sighandler_t=no)
AC_MSG_RESULT($has_sighandler_t)
if test "$has_sighandler_t" = "yes" ; then
AC_DEFINE( HAVE_SIGHANDLER_T, 1, [Define if sighandler_t available] )
fi
##################################################
# Stricter build options (after external packages)
##################################################
......
......@@ -26,10 +26,12 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#ifndef _WIN32_WCE
#include <errno.h>
#include <unistd.h>
#endif /*_WIN32_WCE*/
#include <limits.h>
#include <ctype.h>
#include <unistd.h>
#include <linphonecore.h>
#include "linphonec.h"
#include "private.h"
......@@ -298,7 +300,7 @@ linphonec_command_generator(const char *text, int state)
if (strncmp(name, text, len) == 0)
{
return strdup(name);
return ortp_strdup(name);
}
}
......@@ -593,10 +595,12 @@ lpc_cmd_friend(LinphoneCore *lc, char *args)
args+=4;
if ( ! *args ) return 0;
friend_num = strtol(args, NULL, 10);
#ifndef _WIN32_WCE
if ( errno == ERANGE ) {
linphonec_out("Invalid friend number\n");
return 0;
}
#endif /*_WIN32_WCE*/
linphonec_friend_call(lc, friend_num);
return 1;
}
......@@ -613,10 +617,12 @@ lpc_cmd_friend(LinphoneCore *lc, char *args)
else
{
friend_num = strtol(args, NULL, 10);
#ifndef _WIN32_WCE
if ( errno == ERANGE ) {
linphonec_out("Invalid friend number\n");
return 0;
}
#endif /*_WIN32_WCE*/
}
linphonec_friend_delete(lc, friend_num);
return 1;
......@@ -1423,9 +1429,9 @@ static int lpc_cmd_duration(LinphoneCore *lc, char *args){
static int lpc_cmd_status(LinphoneCore *lc, char *args)
{
if ( ! args ) return 0;
LinphoneProxyConfig *cfg;
if ( ! args ) return 0;
linphone_core_get_default_proxy(lc,&cfg);
if (strstr(args,"register"))
{
......
This diff is collapsed.
......@@ -46,6 +46,7 @@
#endif
#endif
/**************************************************************************
*
* Compile-time defines
......@@ -98,7 +99,7 @@ typedef struct {
/***************************************************************************
*
* Forward declarations
* Forward declarations
*
***************************************************************************/
......
......@@ -43,9 +43,9 @@ endif
AM_CFLAGS=$(STRICT_OPTIONS) -DIN_LINPHONE \
$(ORTP_CFLAGS) \
$(OSIP_CFLAGS) \
$(EXOSIP_CFLAGS) \
$(ORTP_CFLAGS) \
-DENABLE_TRACE \
-DLOG_DOMAIN=\"LinphoneCore\" \
$(IPV6_CFLAGS) \
......
......@@ -19,7 +19,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* enum lookup code */
#ifndef _WIN32_WCE
#include <errno.h>
#endif
#include <string.h>
#include "enum.h"
......
This diff is collapsed.
......@@ -702,7 +702,7 @@ LinphoneFriend *linphone_core_get_friend_by_ref_key(const LinphoneCore *lc, cons
return NULL;
}
#define key_compare(key, word) strncasecmp((key),(word),strlen(key))
#define key_compare(s1,s2) strcmp(s1,s2)
LinphoneSubscribePolicy __policy_str_to_enum(const char* pol){
if (key_compare("accept",pol)==0){
......
This diff is collapsed.
......@@ -344,7 +344,7 @@ LinphoneProxyConfig *linphone_proxy_config_new(void);
int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *obj, const char *server_addr);
void linphone_proxy_config_set_identity(LinphoneProxyConfig *obj, const char *identity);
void linphone_proxy_config_set_route(LinphoneProxyConfig *obj, const char *route);
void linphone_proxy_config_expires(LinphoneProxyConfig *obj, const int expires);
void linphone_proxy_config_expires(LinphoneProxyConfig *obj, int expires);
void linphone_proxy_config_enable_register(LinphoneProxyConfig *obj, bool_t val);
#define linphone_proxy_config_enableregister linphone_proxy_config_enable_register
void linphone_proxy_config_edit(LinphoneProxyConfig *obj);
......
......@@ -30,9 +30,13 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#if !defined(_WIN32_WCE)
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#endif /*_WIN32_WCE*/
#define lp_new0(type,n) (type*)calloc(sizeof(type),n)
......@@ -59,14 +63,14 @@ struct _LpConfig{
LpItem * lp_item_new(const char *key, const char *value){
LpItem *item=lp_new0(LpItem,1);
item->key=strdup(key);
item->value=strdup(value);
item->key=ortp_strdup(key);
item->value=ortp_strdup(value);
return item;
}
LpSection *lp_section_new(const char *name){
LpSection *sec=lp_new0(LpSection,1);
sec->name=strdup(name);
sec->name=ortp_strdup(name);
return sec;
}
......@@ -136,9 +140,9 @@ LpItem *lp_section_find_item(LpSection *sec, const char *name){
void lp_config_parse(LpConfig *lpconfig, FILE *file){
char tmp[MAX_LEN];
LpSection *cur=NULL;
if (file==NULL) return;
while(fgets(tmp,MAX_LEN,file)!=NULL){
char *pos1,*pos2;
pos1=strchr(tmp,'[');
......@@ -168,10 +172,10 @@ void lp_config_parse(LpConfig *lpconfig, FILE *file){
if (pos1!=NULL){
char key[MAX_LEN];
key[0]='\0';
*pos1='\0';
if (sscanf(tmp,"%s",key)>0){
pos1++;
pos2=strchr(pos1,'\n');
if (pos2==NULL) pos2=pos1+strlen(pos1);
......@@ -205,16 +209,18 @@ void lp_config_parse(LpConfig *lpconfig, FILE *file){
LpConfig * lp_config_new(const char *filename){
LpConfig *lpconfig=lp_new0(LpConfig,1);
if (filename!=NULL){
lpconfig->filename=strdup(filename);
lpconfig->filename=ortp_strdup(filename);
lpconfig->file=fopen(filename,"rw");
if (lpconfig->file!=NULL){
lp_config_parse(lpconfig,lpconfig->file);
fclose(lpconfig->file);
#if !defined(_WIN32_WCE)
/* make existing configuration files non-group/world-accessible */
if (chmod(filename, S_IRUSR | S_IWUSR) == -1)
ms_warning("unable to correct permissions on "
"configuration file: %s",
strerror(errno));
#endif /*_WIN32_WCE*/
lpconfig->file=NULL;
lpconfig->modified=0;
}
......@@ -235,7 +241,7 @@ int lp_config_read_file(LpConfig *lpconfig, const char *filename){
void lp_item_set_value(LpItem *item, const char *value){
free(item->value);
item->value=strdup(value);
item->value=ortp_strdup(value);
}
......
......@@ -22,18 +22,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "mediastreamer2/mediastream.h"
#include <stdlib.h>
#include <stdio.h>
#ifdef HAVE_SIGHANDLER_T
#include <signal.h>
#endif /*HAVE_SIGHANDLER_T*/
#include <string.h>
#if !defined(_WIN32_WCE)
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <strings.h>
#endif /*_WIN32_WCE*/
#undef snprintf
#include <ortp/stun.h>
#ifndef WIN32
#if !defined(WIN32)
static char lock_name[80];
static char lock_set=0;
......@@ -41,7 +47,7 @@ static char lock_set=0;
int set_lock_file()
{
FILE *lockfile;
snprintf(lock_name,80,"/tmp/linphone.%i",getuid());
lockfile=fopen(lock_name,"w");
if (lockfile==NULL)
......@@ -60,7 +66,7 @@ int get_lock_file()
{
int pid;
FILE *lockfile;
snprintf(lock_name,80,"/tmp/linphone.%i",getuid());
lockfile=fopen(lock_name,"r");
if (lockfile==NULL)
......@@ -97,15 +103,17 @@ char *int2str(int number)
void check_sound_device(LinphoneCore *lc)
{
int fd,len;
#ifdef _linux
int fd=0;
int len;
int a;
char *file=NULL;
char *i810_audio=NULL;
char *snd_pcm_oss=NULL;
char *snd_mixer_oss=NULL;
char *snd_pcm=NULL;
fd=open("/proc/modules",O_RDONLY);
if (fd>0){
/* read the entire /proc/modules file and check if sound conf seems correct */
/*a=fstat(fd,&statbuf);
......@@ -138,13 +146,12 @@ void check_sound_device(LinphoneCore *lc)
}
}
}else {
#ifdef __linux
ms_warning("Could not open /proc/modules.");
#endif
}
/* now check general volume. Some user forget to rise it and then complain that linphone is
not working */
/* but some other users complain that linphone should not change levels...
/* but some other users complain that linphone should not change levels...
if (lc->sound_conf.sndcard!=NULL){
a=snd_card_get_level(lc->sound_conf.sndcard,SND_CARD_LEVEL_GENERAL);
if (a<50){
......@@ -156,6 +163,7 @@ void check_sound_device(LinphoneCore *lc)
end:
if (file!=NULL) ms_free(file);
if (fd>0) close(fd);
#endif
}
#define UDP_HDR_SZ 8
......@@ -164,12 +172,12 @@ void check_sound_device(LinphoneCore *lc)
const char *payload_type_get_description(PayloadType *pt){
return _((const char *)pt->user_data);
}
}
void payload_type_set_enable(PayloadType *pt,int value)
void payload_type_set_enable(PayloadType *pt,int value)
{
if ((value)!=0) payload_type_set_flag(pt,PAYLOAD_TYPE_ENABLED); \
else payload_type_unset_flag(pt,PAYLOAD_TYPE_ENABLED);
else payload_type_unset_flag(pt,PAYLOAD_TYPE_ENABLED);
}
......@@ -266,7 +274,7 @@ bool_t linphone_core_check_payload_type_usability(LinphoneCore *lc, PayloadType
/*let the video use all the bandwidth minus the maximum bandwidth used by audio */
if (min_video_bw>0)
pt->normal_bitrate=min_video_bw*1000;
else
else
pt->normal_bitrate=1500000; /*around 1.5 Mbit/s*/
ret=TRUE;
}
......@@ -274,7 +282,7 @@ bool_t linphone_core_check_payload_type_usability(LinphoneCore *lc, PayloadType
break;
}
/*if (!ret) ms_warning("Payload %s is not usable with your internet connection.",pt->mime_type);*/
return ret;
}
......@@ -284,7 +292,7 @@ static PayloadType * find_payload(RtpProfile *prof, PayloadType *pt /*from confi
PayloadType *it;
for(i=0;i<127;++i){
it=rtp_profile_get_payload(prof,i);
if (it!=NULL && strcasecmp(pt->mime_type,it->mime_type)==0
if (it!=NULL && strcasecmp(pt->mime_type,it->mime_type)==0
&& (pt->clock_rate==it->clock_rate || pt->clock_rate<=0)
&& payload_type_get_user_data(it)==NULL ){
if ( (pt->recv_fmtp && it->recv_fmtp && strcasecmp(pt->recv_fmtp,it->recv_fmtp)==0) ||
......@@ -316,7 +324,7 @@ static MSList *fix_codec_list(RtpProfile *prof, MSList *conflist)
MSList *elem;
MSList *newlist=NULL;
PayloadType *payload,*confpayload;
for (elem=conflist;elem!=NULL;elem=ms_list_next(elem))
{
confpayload=(PayloadType*)elem->data;
......@@ -350,12 +358,10 @@ void linphone_core_setup_local_rtp_profile(LinphoneCore *lc)
PayloadType *payload;
bool_t prepend;
lc->local_profile=rtp_profile_clone_full(&av_profile);
/* first look at the list given by configuration file to see if
/* first look at the list given by configuration file to see if
it is correct */
audiopt=fix_codec_list(lc->local_profile,lc->codecs_conf.audio_codecs);
videopt=fix_codec_list(lc->local_profile,lc->codecs_conf.video_codecs);
/* now find and add payloads that are not listed in the configuration
codec list */
for (i=0;i<127;i++)
......@@ -384,7 +390,7 @@ void linphone_core_setup_local_rtp_profile(LinphoneCore *lc)
case PAYLOAD_AUDIO_CONTINUOUS:
case PAYLOAD_AUDIO_PACKETIZED:
if (prepend)
audiopt=ms_list_prepend(audiopt,(void *)payload);
audiopt=ms_list_prepend(audiopt,(void *)payload);
else
audiopt=ms_list_append(audiopt,(void *)payload);
break;
......@@ -427,6 +433,7 @@ int from_2char_without_params(osip_from_t *from,char **str)
}
bool_t lp_spawn_command_line_sync(const char *command, char **result,int *command_ret){
#if !defined(_WIN32_WCE)
FILE *f=popen(command,"r");
if (f!=NULL){
int err;
......@@ -442,6 +449,7 @@ bool_t lp_spawn_command_line_sync(const char *command, char **result,int *comman
if (command_ret!=NULL) *command_ret=err;
return TRUE;
}
#endif /*_WIN32_WCE*/
return FALSE;
}
......@@ -454,12 +462,12 @@ bool_t host_has_ipv6_network()
struct ifaddrs *ifp;
struct ifaddrs *ifpstart;