]> sjero.net Git - linphone/commitdiff
Merge branch 'master' of git.savannah.nongnu.org:/srv/git/linphone
authorJehan Monnier <jehan.monnier@linphone.org>
Mon, 4 Oct 2010 15:08:55 +0000 (17:08 +0200)
committerJehan Monnier <jehan.monnier@linphone.org>
Mon, 4 Oct 2010 15:08:55 +0000 (17:08 +0200)
32 files changed:
Makefile.am
configure.ac [new file with mode: 0644]
configure.in [deleted file]
console/Makefile.am
console/commands.c
console/linphonec.c
console/linphonec.h
coreapi/Makefile.am
coreapi/address.c
coreapi/callbacks.c
coreapi/help/Makefile.am
coreapi/linphonecall.c
coreapi/linphonecore.c
coreapi/linphonecore.h
coreapi/offeranswer.c
coreapi/private.h
coreapi/proxy.c
coreapi/sal.c
coreapi/sal.h
coreapi/sal_eXosip2.c
gtk/Makefile.am
gtk/incall_view.c
gtk/linphone.h
gtk/loginframe.c
gtk/main.c
gtk/main.ui
gtk/parameters.ui
gtk/support.c
mediastreamer2
pixmaps/Makefile.am
share/Makefile.am
share/rings/oldphone-mono-30s.caf [new file with mode: 0644]

index e0c3068064685609d210e2087101e96e1467288a..da3a8d7e3ca0ff7fe704f3f0c556b88e986f6220 100644 (file)
@@ -3,13 +3,20 @@
 # let make re-run automake upon need
 ACLOCAL_AMFLAGS = -I m4 $(ACLOCAL_MACOS_FLAGS)
 
+if EXTERNAL_MEDIASTREAMER
+MS2_DIR=
+else
+MS2_DIR=mediastreamer2
+endif
+
 if EXTERNAL_ORTP
-ORTP_DIR =
+ORTP_DIR=
 else
-ORTP_DIR = oRTP
+ORTP_DIR=oRTP
 endif
 
-SUBDIRS = m4 pixmaps po $(ORTP_DIR) mediastreamer2\
+
+SUBDIRS = m4 pixmaps po $(ORTP_DIR) $(MS2_DIR) \
                coreapi console gtk share scripts
 
 
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..14d5a35
--- /dev/null
@@ -0,0 +1,496 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT([linphone],[3.3.99.4],[linphone-developers@nongnu.org])
+AC_CANONICAL_SYSTEM
+AC_CONFIG_SRCDIR([coreapi/linphonecore.c])
+
+dnl Source packaging numbers
+
+LINPHONE_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
+LINPHONE_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
+LINPHONE_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
+LINPHONE_EXTRA_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f4)
+
+dnl program extension
+LINPHONE_VERSION=$LINPHONE_MAJOR_VERSION.$LINPHONE_MINOR_VERSION.${LINPHONE_MICRO_VERSION}
+if test "$LINPHONE_EXTRA_VERSION" != "" ;then
+       LINPHONE_VERSION=$LINPHONE_VERSION.${LINPHONE_EXTRA_VERSION}
+fi
+
+LIBLINPHONE_SO_CURRENT=4 dnl increment this number when you add/change/remove an interface
+LIBLINPHONE_SO_REVISION=0 dnl increment this number when you change source code, without changing interfaces; set to 0 when incrementing CURRENT
+LIBLINPHONE_SO_AGE=0 dnl increment this number when you add an interface, set to 0 if you remove an interface
+
+LIBLINPHONE_SO_VERSION=$LIBLINPHONE_SO_CURRENT:$LIBLINPHONE_SO_REVISION:$LIBLINPHONE_SO_AGE
+
+AC_SUBST(LIBLINPHONE_SO_VERSION, $LIBLINPHONE_SO_VERSION)
+AC_SUBST(LINPHONE_VERSION)
+
+AC_MSG_NOTICE([$PACKAGE_NAME-$PACKAGE_VERSION          A full featured audio/video sip phone.])
+AC_MSG_NOTICE([licensed under the terms of the General Public License (GPL)])
+
+AM_INIT_AUTOMAKE
+AC_SUBST([LIBTOOL_DEPS])
+m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
+AC_CONFIG_HEADER(config.h)
+AC_CONFIG_MACRO_DIR([m4])
+AC_SUBST([mkdir_p])
+AC_ISC_POSIX
+AC_PROG_CC
+AC_C_INLINE
+AM_PROG_CC_STDC
+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 "
+               CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
+               LIBS="$LIBS -lws2_32"
+               GUI_FLAGS="-mwindows"
+               CONSOLE_FLAGS="-mconsole"
+               mingw_found=yes
+       ;;
+       *darwin*)
+               dnl use macport installation
+               ACLOCAL_MACOS_FLAGS="-I /opt/local/share/aclocal"
+       ;;
+esac
+
+AC_SUBST(ACLOCAL_MACOS_FLAGS)
+AC_SUBST(CONSOLE_FLAGS)
+AC_SUBST(GUI_FLAGS)
+
+dnl localization tools
+IT_PROG_INTLTOOL([0.40], [no-xml])
+
+dnl Initialize libtool
+AC_LIBTOOL_WIN32_DLL
+AC_PROG_LIBTOOL
+AM_PROG_LIBTOOL
+AC_ENABLE_SHARED(yes)
+AC_ENABLE_STATIC(no)
+
+
+AC_CONFIG_COMMANDS([libtool-hacking],[
+if test "$mingw_found" = "yes" ; then
+       echo "Hacking libtool to work with mingw..."
+       sed -e 's/\*\" \$a_deplib \"\*/\*/' < ./libtool > libtool.tmp
+       cp -f ./libtool.tmp ./libtool
+       rm -f ./libtool.tmp
+fi
+],[mingw_found=$mingw_found])
+
+dnl Add the languages which your application supports here.
+PKG_PROG_PKG_CONFIG
+ALL_LINGUAS="fr it de ja es pl cs nl sv pt_BR hu ru zh_CN"
+AC_SUBST(ALL_LINGUAS)
+AC_DEFINE_UNQUOTED(LINPHONE_ALL_LANGS, "$ALL_LINGUAS", [All supported languages])
+
+if test "$mingw_found" != "yes" ; then
+dnl gettext macro does not work properly under mingw.
+AM_GNU_GETTEXT([external])
+LIBS="$LIBS $LIBINTL"
+else
+       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
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[The name of the gettext package name])
+AC_CHECK_LIB(intl,libintl_gettext)
+
+AC_CHECK_FUNCS([get_current_dir_name strndup stpcpy] )
+
+dnl conditionnal build of console interface.
+AC_ARG_ENABLE(console_ui,
+      [  --enable-console_ui=[yes/no]    Turn on or off compilation of console interface [default=yes]],
+      [case "${enableval}" in
+        yes) console_ui=true ;;
+        no)  console_ui=false ;;
+        *) AC_MSG_ERROR(bad value ${enableval} for --enable-console_ui) ;;
+      esac],[console_ui=true])
+
+dnl conditionnal build of gtk interface.
+AC_ARG_ENABLE(gtk_ui,
+      [  --enable-gtk_ui=[yes/no]    Turn on or off compilation of gtk interface [default=yes]],
+      [case "${enableval}" in
+        yes) gtk_ui=true ;;
+        no)  gtk_ui=false ;;
+        *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk_ui) ;;
+      esac],[gtk_ui=true])
+
+
+if test "$gtk_ui" = "true" ; then
+       PKG_CHECK_MODULES(LIBGTK, gtk+-2.0 >= 2.4.0 gthread-2.0)
+       AC_SUBST(LIBGTK_CFLAGS)
+       AC_SUBST(LIBGTK_LIBS)
+else
+       echo "GTK interface compilation is disabled."
+fi
+
+
+dnl os-specific problems not handled by existing macros.
+case "$host_os" in
+       *freebsd*)
+               LDFLAGS="$LDFLAGS -pthread"
+               ;;
+esac
+
+case "$host_cpu" in
+       *arm*)
+               AC_DEFINE(__ARM__,1,[Defined if we are compiling for arm processor])
+               use_arm_toolchain=yes
+               ;;
+esac
+
+AC_ARG_WITH( configdir,
+      [  --with-configdir      Set a APPDATA subdir where linphone is supposed to find its config (windows only) ],
+      [ configdir=${withval}],[ configdir="Linphone" ])
+
+AC_DEFINE_UNQUOTED(LINPHONE_CONFIG_DIR,"$configdir",[Windows appdata subdir where linphonerc can be found])
+
+AC_ARG_ENABLE(manual,
+      [  --disable-manual    Do not attempt to build html linphone's user documentation],
+      [case "${enableval}" in
+        yes) build_manual=yes ;;
+        no)  build_manual=false ;;
+        *) AC_MSG_ERROR(bad value ${enableval} for --enable-manual) ;;
+      esac],[build_manual=yes])
+
+AC_ARG_ENABLE(date,
+      [  --enable-date    Use build date in internal version number],
+      [case "${enableval}" in
+        yes) use_date=yes ;;
+        no)  use_date=no ;;
+        *) AC_MSG_ERROR(bad value ${enableval} for --enable-date) ;;
+      esac],[use_date=no])
+
+if test x$use_date =  xyes ; then
+       AC_DEFINE(USE_BUILDDATE_VERSION,1,[Tell whether date_version.h must be used])
+fi
+
+
+dnl enable ipv6 support
+AC_ARG_ENABLE(ipv6,
+      [  --enable-ipv6    Turn on ipv6 support],
+      [case "${enableval}" in
+        yes)  ipv6=true;;
+        no)   ipv6=false;;
+        *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
+      esac],[ipv6=true])
+IPV6_CFLAGS=
+if test x$ipv6 = xtrue ; then
+       IPV6_CFLAGS=-DINET6
+fi
+AC_SUBST(IPV6_CFLAGS)
+
+dnl enable truespeech codec support
+AC_ARG_ENABLE(truespeech,
+      [  --enable-truespeech    Turn on TrueSpeech support (x86 only)],
+      [case "${enableval}" in
+        yes)  truespeech=true;;
+        no)   truespeech=false;;
+        *) AC_MSG_ERROR(bad value ${enableval} for --enable-truespeech) ;;
+      esac],[truespeech=false])
+TRUESPEECH_CFLAGS=
+if test x$truespeech = xtrue ; then
+       TRUESPEECH_CFLAGS=-DTRUESPEECH
+fi
+AC_SUBST(TRUESPEECH_CFLAGS)
+AM_CONDITIONAL([BUILD_TRUESPEECH], [test x$truespeech = xtrue])
+
+AC_ARG_ENABLE(nonstandard-gsm,
+      [  --enable-nonstandard-gsm    Enable GSM codec at nonstandard rates (11025hz, 16000hz)],
+      [case "${enableval}" in
+        yes) exotic_gsm=yes
+       AC_DEFINE(ENABLE_NONSTANDARD_GSM,1,[Defined when using gsm at nonstandard rates])
+        ;;
+        no)  exotic_gsm=no ;;
+        *) AC_MSG_ERROR(bad value ${enableval} for --enable-nonstandard-gsm) ;;
+      esac],[exotic_gsm=no])
+
+
+dnl support for RSVP (by Vincent Maury)
+AC_ARG_ENABLE(rsvp,
+[  --enable-rsvp           enable support for QoS reservations.],
+AC_DEFINE(VINCENT_MAURY_RSVP,1,[Tell whether RSVP support
+should be compiled.]) )
+
+if test "x${prefix}" = "xNONE"; then
+       package_prefix=${ac_default_prefix}
+else
+       package_prefix=${prefix}
+fi
+
+if test x$mingw_found = xyes ; then
+dnl allow binaries to install everywhere
+package_prefix="."
+fi
+
+dnl Set PACKAGE_LOCALE_DIR in config.h.
+DATADIRNAME=share
+AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${package_prefix}/${DATADIRNAME}/locale",[Defines the place where locales can be found])
+
+AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${package_prefix}/${DATADIRNAME}",[Defines the place where data are found])
+
+dnl Set PACKAGE_SOUND_DIR in config.h.
+AC_DEFINE_UNQUOTED(PACKAGE_SOUND_DIR, "${package_prefix}/${DATADIRNAME}/sounds/linphone",[Defines the place where linphone sounds are found])
+
+
+dnl check if we have the getifaddrs() sytem call
+AC_CHECK_FUNCS(getifaddrs)
+
+dnl check for osip2
+LP_CHECK_OSIP2
+
+dnl setup flags for exosip library
+LP_SETUP_EXOSIP
+
+if test "$console_ui" = "true" ; then
+dnl check gnu readline
+LP_CHECK_READLINE
+else
+echo "Console interface compilation is disabled."
+fi
+
+AC_WORDS_BIGENDIAN
+
+dnl normaly this should only by done by mediastreamer2/configure.ac
+dnl but to workaround bugs when cross-compiling for arm-linux,
+dnl we need to have SPEEX_LIBS defined
+dnl Furthermore it is good to repeat here all mediastreamer2 toggles
+dnl since top-level configure --help will not print them.
+
+PKG_CHECK_MODULES(SPEEX, speex >= 1.1.6, build_speex=yes)
+AC_SUBST(SPEEX_LIBS)
+
+dnl conditionnal build of video support
+AC_ARG_ENABLE(video,
+               [  --enable-video    Turn on video support compiling],
+               [case "${enableval}" in
+               yes) video=true ;;
+               no)  video=false ;;
+               *) AC_MSG_ERROR(bad value ${enableval} for --enable-video) ;;
+               esac],[video=true])
+               
+AC_ARG_WITH( ffmpeg,
+               [  --with-ffmpeg                Sets the installation prefix of ffmpeg, needed for video support. [default=/usr] ],
+               [ ffmpegdir=${withval}],[ ffmpegdir=/usr ])
+
+AC_ARG_WITH( sdl,
+               [  --with-sdl           Sets the installation prefix of libSDL, needed for video support. [default=/usr] ],
+               [ libsdldir=${withval}],[ libsdldir=/usr ])
+
+AC_ARG_ENABLE(x11,
+                         [  --disable-x11    Disable X11 support],
+                         [case "${enableval}" in
+                         yes) enable_x11=true ;;
+                         no)  enable_x11=false ;;
+                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-x11) ;;
+                         esac],[enable_x11=true])
+
+if test "$video" = "true"; then
+       
+       if test "$enable_x11" = "true"; then
+          AC_CHECK_HEADERS(X11/Xlib.h)
+       fi
+       AC_DEFINE(VIDEO_ENABLED,1,[defined if video support is available])
+fi
+
+AC_ARG_ENABLE(alsa,
+      [  --enable-alsa    Turn on alsa native support compiling],
+      [case "${enableval}" in
+        yes) alsa=true ;;
+        no)  alsa=false ;;
+        *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsa) ;;
+      esac],[alsa=true])
+
+AC_ARG_ENABLE(artsc,
+      [  --enable-artsc    Turn on artsc (kde) sound input/output (auto) ],
+      [case "${enableval}" in
+        yes) artsc=true ;;
+        no)  artsc=false ;;
+        *) AC_MSG_ERROR(bad value ${enableval} for --enable-artsc) ;;
+      esac],[artsc=false])
+
+AC_ARG_ENABLE(portaudio,
+      [  --enable-portaudio    Turn on portaudio native support compiling],
+      [case "${enableval}" in
+        yes) portaudio=true ;;
+        no)  portaudio=false ;;
+        *) AC_MSG_ERROR(bad value ${enableval} for --enable-portaudio) ;;
+      esac],[portaudio=false])
+
+dnl build console if required
+AM_CONDITIONAL(BUILD_CONSOLE, test x$console_ui = xtrue)
+dnl special things for arm-linux cross compilation toolchain
+AM_CONDITIONAL(ARMBUILD, test x$use_arm_toolchain = xyes)
+dnl compilation of gtk user interface
+AM_CONDITIONAL(BUILD_GTK_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)
+##################################################
+
+
+AC_ARG_ENABLE(strict,
+       AC_HELP_STRING([--enable-strict],
+                      [Build with stricter options (gcc only) @<:@yes@:>@]),[
+       strictness="${enableval}"],[strictness=yes]
+)
+
+if test "$GCC$strictness" = "yesyes" ; then
+       STRICT_OPTIONS="-Wall "
+       STRICT_OPTIONS="$STRICT_OPTIONS -Werror"
+       CFLAGS="$CFLAGS -fno-strict-aliasing"
+fi
+
+AC_SUBST(STRICT_OPTIONS)
+
+top_srcdir=`dirname $0`
+
+AC_ARG_ENABLE([external-mediastreamer],
+      [AS_HELP_STRING([--enable-external-mediastreamer],[Use external mediastreamer library])],,
+      [enable_external_mediastreamer=no])
+
+AS_CASE($enable_external_mediastreamer,
+               [yes],[
+                       PKG_CHECK_MODULES([MEDIASTREAMER], [mediastreamer])
+                       MS2_VERSION=`$PKG_CONFIG --modversion mediastreamer`
+                       AM_CONDITIONAL(EXTERNAL_MEDIASTREAMER, [true])],
+               [no],[
+                       AC_CONFIG_SUBDIRS( mediastreamer2 )
+                       MEDIASTREAMER_DIR=${top_srcdir}/mediastreamer2
+                       MEDIASTREAMER_CFLAGS="-I\$(top_srcdir)/mediastreamer2/include"
+                       MEDIASTREAMER_LIBS="\$(top_builddir)/mediastreamer2/src/libmediastreamer.la"
+dnl need to temporary change quotes to allow square brackets
+                       changequote(<<, >>)
+                       MS2_VERSION=`grep -e '^.C_INIT(' $MEDIASTREAMER_DIR/configure.ac | sed -e 's:\([^(]\+\)(\[mediastreamer\],\[\(.*\)\]):\2:g'`
+                       changequote([, ])
+                       AM_CONDITIONAL(EXTERNAL_MEDIASTREAMER, [false])],
+        [AC_MSG_ERROR([bad value '${enable_external_mediastreamer}' for --enable-external-mediastreamer])])
+
+AC_SUBST(MEDIASTREAMER_CFLAGS)
+AC_SUBST(MEDIASTREAMER_LIBS)
+AC_SUBST([MS2_VERSION])
+
+dnl check for db2html (docbook) to generate html user manual
+AC_CHECK_PROG(have_sgmltools,sgmltools, yes, no)
+AM_CONDITIONAL(ENABLE_MANUAL, test x$have_sgmltools$build_manual = xyesyes )
+
+dnl for external use of linphone libs
+LINPHONE_CFLAGS="-I${includedir} -I${includedir}/linphone"
+LINPHONE_LIBS="-L${libdir} -llinphone"
+
+if test x$mingw_found = xyes ; then
+       LINPHONE_LIBS="$LINPHONE_LIBS $OSIP_LIBS"
+fi
+AC_SUBST(LINPHONE_CFLAGS)
+AC_SUBST(LINPHONE_LIBS)
+
+AC_DEFINE_UNQUOTED(LINPHONE_VERSION,"$PACKAGE_VERSION",[Linphone's version number])
+
+AC_DEFINE_UNQUOTED(LINPHONE_PLUGINS_DIR, "${package_prefix}/lib/liblinphone/plugins" ,[path of liblinphone plugins, not mediastreamer2 plugins])
+LINPHONE_PLUGINS_DIR="${package_prefix}/lib/liblinphone/plugins"
+AC_SUBST(LINPHONE_PLUGINS_DIR)
+
+AC_ARG_ENABLE(external-ortp,
+      [  --enable-external-ortp    Use external oRTP library],
+      [case "${enableval}" in
+        yes) external_ortp=true ;;
+        no)  external_ortp=false ;;
+        *) AC_MSG_ERROR(bad value ${enableval} for --enable-external-ortp) ;;
+      esac],[external_ortp=false])
+
+if test "$external_ortp" = 'true'; then
+       PKG_CHECK_MODULES([ORTP], [ortp])
+       ORTP_VERSION=`$PKG_CONFIG --modversion ortp`
+else
+       AC_CONFIG_SUBDIRS( oRTP )
+       ORTP_CFLAGS="-I\$(top_srcdir)/oRTP/include"
+       ORTP_LIBS="\$(top_builddir)/oRTP/src/libortp.la"
+       if test x$ac_cv_c_bigendian = xyes ; then
+               ORTP_CFLAGS="$ORTP_CFLAGS -DORTP_BIGENDIAN"
+       fi
+       changequote(<<, >>)
+       ORTP_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/oRTP/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'`
+       changequote([, ])
+fi
+AC_SUBST(ORTP_CFLAGS)
+AC_SUBST(ORTP_LIBS)
+AC_SUBST([ORTP_VERSION])
+
+AM_CONDITIONAL(EXTERNAL_ORTP, [test "$external_ortp" = 'true'])
+
+dnl ##################################################
+dnl # Check for doxygen
+dnl ##################################################
+
+AC_PATH_PROG(DOXYGEN,doxygen,false)
+AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
+
+
+AC_OUTPUT([ 
+Makefile 
+m4/Makefile
+po/Makefile.in
+pixmaps/Makefile
+coreapi/Makefile
+coreapi/help/Makefile
+coreapi/help/Doxyfile
+coreapi/help/doxygen.dox
+gtk/Makefile
+console/Makefile
+share/Makefile
+share/C/Makefile
+share/fr/Makefile
+share/it/Makefile
+share/ja/Makefile
+share/cs/Makefile
+share/linphone.pc
+share/linphone.desktop
+scripts/Makefile
+linphone.spec
+linphone.iss
+])
+
+echo "Linphone build configuration ended."
+
+if test x$gtk_ui = xtrue ; then
+       echo "* GTK interface will be compiled."
+fi
+if test x$console_ui = xtrue ; then
+       echo "* Console interface will be compiled."
+fi
+
+echo "Now type 'make' to compile, and then 'make install' as root to install it."
diff --git a/configure.in b/configure.in
deleted file mode 100644 (file)
index fc1c4c0..0000000
+++ /dev/null
@@ -1,474 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-
-AC_INIT([linphone],[3.3.99.3],[linphone-developers@nongnu.org])
-AC_CANONICAL_SYSTEM
-
-dnl Source packaging numbers
-
-LINPHONE_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
-LINPHONE_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
-LINPHONE_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
-LINPHONE_EXTRA_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f4)
-
-dnl program extension
-LINPHONE_VERSION=$LINPHONE_MAJOR_VERSION.$LINPHONE_MINOR_VERSION.${LINPHONE_MICRO_VERSION}
-if test "$LINPHONE_EXTRA_VERSION" != "" ;then
-       LINPHONE_VERSION=$LINPHONE_VERSION.${LINPHONE_EXTRA_VERSION}
-fi
-
-LIBLINPHONE_SO_CURRENT=4 dnl increment this number when you add/change/remove an interface
-LIBLINPHONE_SO_REVISION=0 dnl increment this number when you change source code, without changing interfaces; set to 0 when incrementing CURRENT
-LIBLINPHONE_SO_AGE=0 dnl increment this number when you add an interface, set to 0 if you remove an interface
-
-LIBLINPHONE_SO_VERSION=$LIBLINPHONE_SO_CURRENT:$LIBLINPHONE_SO_REVISION:$LIBLINPHONE_SO_AGE
-
-AC_SUBST(LIBLINPHONE_SO_VERSION, $LIBLINPHONE_SO_VERSION)
-AC_SUBST(LINPHONE_VERSION)
-
-AC_MSG_NOTICE([$PACKAGE_NAME-$PACKAGE_VERSION          A full featured audio/video sip phone.])
-AC_MSG_NOTICE([licensed under the terms of the General Public License (GPL)])
-
-AM_INIT_AUTOMAKE([tar-ustar])
-m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
-AC_CONFIG_HEADER(config.h)
-AC_CONFIG_MACRO_DIR([m4])
-AC_SUBST([mkdir_p])
-AC_ISC_POSIX
-AC_PROG_CC
-AC_C_INLINE
-AM_PROG_CC_STDC
-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 "
-               CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
-               LIBS="$LIBS -lws2_32"
-               GUI_FLAGS="-mwindows"
-               CONSOLE_FLAGS="-mconsole"
-               mingw_found=yes
-       ;;
-       *darwin*)
-               dnl use macport installation
-               ACLOCAL_MACOS_FLAGS="-I /opt/local/share/aclocal"
-       ;;
-esac
-
-AC_SUBST(ACLOCAL_MACOS_FLAGS)
-AC_SUBST(CONSOLE_FLAGS)
-AC_SUBST(GUI_FLAGS)
-
-dnl localization tools
-ifdef([IT_PROG_INTLTOOL],[IT_PROG_INTLTOOL],[AC_PROG_INTLTOOL])
-dnl Initialize libtool
-AC_LIBTOOL_WIN32_DLL
-AC_PROG_LIBTOOL
-AM_PROG_LIBTOOL
-AC_ENABLE_SHARED(yes)
-AC_ENABLE_STATIC(no)
-
-
-AC_CONFIG_COMMANDS([libtool-hacking],[
-if test "$mingw_found" = "yes" ; then
-       echo "Hacking libtool to work with mingw..."
-       sed -e 's/\*\" \$a_deplib \"\*/\*/' < ./libtool > libtool.tmp
-       cp -f ./libtool.tmp ./libtool
-       rm -f ./libtool.tmp
-fi
-],[mingw_found=$mingw_found])
-
-dnl Add the languages which your application supports here.
-PKG_PROG_PKG_CONFIG
-ALL_LINGUAS="fr it de ja es pl cs nl sv pt_BR hu ru zh_CN"
-AC_SUBST(ALL_LINGUAS)
-AC_DEFINE_UNQUOTED(LINPHONE_ALL_LANGS, "$ALL_LINGUAS", [All supported languages])
-
-if test "$mingw_found" != "yes" ; then
-dnl gettext macro does not work properly under mingw.
-AM_GNU_GETTEXT([external])
-LIBS="$LIBS $LIBINTL"
-else
-       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
-AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[The name of the gettext package name])
-AC_CHECK_LIB(intl,libintl_gettext)
-
-AC_CHECK_FUNCS([get_current_dir_name strndup stpcpy] )
-
-dnl conditionnal build of console interface.
-AC_ARG_ENABLE(console_ui,
-      [  --enable-console_ui=[yes/no]    Turn on or off compilation of console interface [default=yes]],
-      [case "${enableval}" in
-        yes) console_ui=true ;;
-        no)  console_ui=false ;;
-        *) AC_MSG_ERROR(bad value ${enableval} for --enable-console_ui) ;;
-      esac],[console_ui=true])
-
-dnl conditionnal build of gtk interface.
-AC_ARG_ENABLE(gtk_ui,
-      [  --enable-gtk_ui=[yes/no]    Turn on or off compilation of gtk interface [default=yes]],
-      [case "${enableval}" in
-        yes) gtk_ui=true ;;
-        no)  gtk_ui=false ;;
-        *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk_ui) ;;
-      esac],[gtk_ui=true])
-
-
-if test "$gtk_ui" = "true" ; then
-       PKG_CHECK_MODULES(LIBGTK, gtk+-2.0 >= 2.4.0 gthread-2.0)
-       AC_SUBST(LIBGTK_CFLAGS)
-       AC_SUBST(LIBGTK_LIBS)
-else
-       echo "GTK interface compilation is disabled."
-fi
-
-
-dnl os-specific problems not handled by existing macros.
-case "$host_os" in
-       *freebsd*)
-               LDFLAGS="$LDFLAGS -pthread"
-               ;;
-esac
-
-case "$host_cpu" in
-       *arm*)
-               AC_DEFINE(__ARM__,1,[Defined if we are compiling for arm processor])
-               use_arm_toolchain=yes
-               ;;
-esac
-
-AC_ARG_WITH( configdir,
-      [  --with-configdir      Set a APPDATA subdir where linphone is supposed to find its config (windows only) ],
-      [ configdir=${withval}],[ configdir="Linphone" ])
-
-AC_DEFINE_UNQUOTED(LINPHONE_CONFIG_DIR,"$configdir",[Windows appdata subdir where linphonerc can be found])
-
-AC_ARG_ENABLE(manual,
-      [  --disable-manual    Do not attempt to build html linphone's user documentation],
-      [case "${enableval}" in
-        yes) build_manual=yes ;;
-        no)  build_manual=false ;;
-        *) AC_MSG_ERROR(bad value ${enableval} for --enable-manual) ;;
-      esac],[build_manual=yes])
-
-AC_ARG_ENABLE(date,
-      [  --enable-date    Use build date in internal version number],
-      [case "${enableval}" in
-        yes) use_date=yes ;;
-        no)  use_date=no ;;
-        *) AC_MSG_ERROR(bad value ${enableval} for --enable-date) ;;
-      esac],[use_date=no])
-
-if test x$use_date =  xyes ; then
-       AC_DEFINE(USE_BUILDDATE_VERSION,1,[Tell whether date_version.h must be used])
-fi
-
-
-dnl enable ipv6 support
-AC_ARG_ENABLE(ipv6,
-      [  --enable-ipv6    Turn on ipv6 support],
-      [case "${enableval}" in
-        yes)  ipv6=true;;
-        no)   ipv6=false;;
-        *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
-      esac],[ipv6=true])
-IPV6_CFLAGS=
-if test x$ipv6 = xtrue ; then
-       IPV6_CFLAGS=-DINET6
-fi
-AC_SUBST(IPV6_CFLAGS)
-
-dnl enable truespeech codec support
-AC_ARG_ENABLE(truespeech,
-      [  --enable-truespeech    Turn on TrueSpeech support (x86 only)],
-      [case "${enableval}" in
-        yes)  truespeech=true;;
-        no)   truespeech=false;;
-        *) AC_MSG_ERROR(bad value ${enableval} for --enable-truespeech) ;;
-      esac],[truespeech=false])
-TRUESPEECH_CFLAGS=
-if test x$truespeech = xtrue ; then
-       TRUESPEECH_CFLAGS=-DTRUESPEECH
-fi
-AC_SUBST(TRUESPEECH_CFLAGS)
-AM_CONDITIONAL([BUILD_TRUESPEECH], [test x$truespeech = xtrue])
-
-AC_ARG_ENABLE(nonstandard-gsm,
-      [  --enable-nonstandard-gsm    Enable GSM codec at nonstandard rates (11025hz, 16000hz)],
-      [case "${enableval}" in
-        yes) exotic_gsm=yes
-       AC_DEFINE(ENABLE_NONSTANDARD_GSM,1,[Defined when using gsm at nonstandard rates])
-        ;;
-        no)  exotic_gsm=no ;;
-        *) AC_MSG_ERROR(bad value ${enableval} for --enable-nonstandard-gsm) ;;
-      esac],[exotic_gsm=no])
-
-
-dnl support for RSVP (by Vincent Maury)
-AC_ARG_ENABLE(rsvp,
-[  --enable-rsvp           enable support for QoS reservations.],
-AC_DEFINE(VINCENT_MAURY_RSVP,1,[Tell whether RSVP support
-should be compiled.]) )
-
-if test "x${prefix}" = "xNONE"; then
-       package_prefix=${ac_default_prefix}
-else
-       package_prefix=${prefix}
-fi
-
-if test x$mingw_found = xyes ; then
-dnl allow binaries to install everywhere
-package_prefix="."
-fi
-
-dnl Set PACKAGE_LOCALE_DIR in config.h.
-DATADIRNAME=share
-AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${package_prefix}/${DATADIRNAME}/locale",[Defines the place where locales can be found])
-
-AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${package_prefix}/${DATADIRNAME}",[Defines the place where data are found])
-
-dnl Set PACKAGE_SOUND_DIR in config.h.
-AC_DEFINE_UNQUOTED(PACKAGE_SOUND_DIR, "${package_prefix}/${DATADIRNAME}/sounds/linphone",[Defines the place where linphone sounds are found])
-
-
-dnl check if we have the getifaddrs() sytem call
-AC_CHECK_FUNCS(getifaddrs)
-
-dnl check for osip2
-LP_CHECK_OSIP2
-
-dnl setup flags for exosip library
-LP_SETUP_EXOSIP
-
-if test "$console_ui" = "true" ; then
-dnl check gnu readline
-LP_CHECK_READLINE
-else
-echo "Console interface compilation is disabled."
-fi
-
-AC_WORDS_BIGENDIAN
-
-dnl normaly this should only by done by mediastreamer2/configure.ac
-dnl but to workaround bugs when cross-compiling for arm-linux,
-dnl we need to have SPEEX_LIBS defined
-dnl Furthermore it is good to repeat here all mediastreamer2 toggles
-dnl since top-level configure --help will not print them.
-
-PKG_CHECK_MODULES(SPEEX, speex >= 1.1.6, build_speex=yes)
-AC_SUBST(SPEEX_LIBS)
-
-dnl conditionnal build of video support
-AC_ARG_ENABLE(video,
-               [  --enable-video    Turn on video support compiling],
-               [case "${enableval}" in
-               yes) video=true ;;
-               no)  video=false ;;
-               *) AC_MSG_ERROR(bad value ${enableval} for --enable-video) ;;
-               esac],[video=true])
-               
-AC_ARG_WITH( ffmpeg,
-               [  --with-ffmpeg                Sets the installation prefix of ffmpeg, needed for video support. [default=/usr] ],
-               [ ffmpegdir=${withval}],[ ffmpegdir=/usr ])
-
-AC_ARG_WITH( sdl,
-               [  --with-sdl           Sets the installation prefix of libSDL, needed for video support. [default=/usr] ],
-               [ libsdldir=${withval}],[ libsdldir=/usr ])
-
-AC_ARG_ENABLE(x11,
-                         [  --disable-x11    Disable X11 support],
-                         [case "${enableval}" in
-                         yes) enable_x11=true ;;
-                         no)  enable_x11=false ;;
-                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-x11) ;;
-                         esac],[enable_x11=true])
-
-if test "$video" = "true"; then
-       
-       if test "$enable_x11" = "true"; then
-          AC_CHECK_HEADERS(X11/Xlib.h)
-       fi
-       AC_DEFINE(VIDEO_ENABLED,1,[defined if video support is available])
-fi
-
-AC_ARG_ENABLE(alsa,
-      [  --enable-alsa    Turn on alsa native support compiling],
-      [case "${enableval}" in
-        yes) alsa=true ;;
-        no)  alsa=false ;;
-        *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsa) ;;
-      esac],[alsa=true])
-
-AC_ARG_ENABLE(artsc,
-      [  --enable-artsc    Turn on artsc (kde) sound input/output (auto) ],
-      [case "${enableval}" in
-        yes) artsc=true ;;
-        no)  artsc=false ;;
-        *) AC_MSG_ERROR(bad value ${enableval} for --enable-artsc) ;;
-      esac],[artsc=false])
-
-AC_ARG_ENABLE(portaudio,
-      [  --enable-portaudio    Turn on portaudio native support compiling],
-      [case "${enableval}" in
-        yes) portaudio=true ;;
-        no)  portaudio=false ;;
-        *) AC_MSG_ERROR(bad value ${enableval} for --enable-portaudio) ;;
-      esac],[portaudio=false])
-
-dnl build console if required
-AM_CONDITIONAL(BUILD_CONSOLE, test x$console_ui = xtrue)
-dnl special things for arm-linux cross compilation toolchain
-AM_CONDITIONAL(ARMBUILD, test x$use_arm_toolchain = xyes)
-dnl compilation of gtk user interface
-AM_CONDITIONAL(BUILD_GTK_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)
-##################################################
-
-
-AC_ARG_ENABLE(strict,
-       AC_HELP_STRING([--enable-strict],
-                      [Build with stricter options (gcc only) @<:@yes@:>@]),[
-       strictness="${enableval}"],[strictness=yes]
-)
-
-if test "$GCC$strictness" = "yesyes" ; then
-       STRICT_OPTIONS="-Wall "
-       STRICT_OPTIONS="$STRICT_OPTIONS -Werror"
-       CFLAGS="$CFLAGS -fno-strict-aliasing"
-fi
-
-AC_SUBST(STRICT_OPTIONS)
-
-AC_CONFIG_SUBDIRS( mediastreamer2 )
-
-dnl check for db2html (docbook) to generate html user manual
-AC_CHECK_PROG(have_sgmltools,sgmltools, yes, no)
-AM_CONDITIONAL(ENABLE_MANUAL, test x$have_sgmltools$build_manual = xyesyes )
-
-dnl for external use of linphone libs
-LINPHONE_CFLAGS="-I${includedir} -I${includedir}/linphone  "
-LINPHONE_LIBS="-L${libdir}  -llinphone"
-
-if test x$mingw_found = xyes ; then
-       LINPHONE_LIBS="$LINPHONE_LIBS $OSIP_LIBS"
-fi
-AC_SUBST(LINPHONE_CFLAGS)
-AC_SUBST(LINPHONE_LIBS)
-
-
-AC_DEFINE_UNQUOTED(LINPHONE_VERSION,"$PACKAGE_VERSION",[Linphone's version number])
-
-AC_DEFINE_UNQUOTED(LINPHONE_PLUGINS_DIR, "${package_prefix}/lib/liblinphone/plugins" ,[path of liblinphone plugins, not mediastreamer2 plugins])
-LINPHONE_PLUGINS_DIR="${package_prefix}/lib/liblinphone/plugins"
-AC_SUBST(LINPHONE_PLUGINS_DIR)
-
-AC_ARG_ENABLE(external-ortp,
-      [  --enable-external-ortp    Use external oRTP library],
-      [case "${enableval}" in
-        yes) external_ortp=true ;;
-        no)  external_ortp=false ;;
-        *) AC_MSG_ERROR(bad value ${enableval} for --enable-external-ortp) ;;
-      esac],[external_ortp=false])
-
-if test "$external_ortp" = 'true'; then
-       LP_CHECK_ORTP
-else
-       AC_CONFIG_SUBDIRS( oRTP )
-       ORTP_CFLAGS="-I\$(top_srcdir)/oRTP/include"
-       ORTP_LIBS="\$(top_builddir)/oRTP/src/libortp.la"
-       if test x$ac_cv_c_bigendian = xyes ; then
-               ORTP_CFLAGS="$ORTP_CFLAGS -DORTP_BIGENDIAN"
-       fi
-fi
-AC_SUBST(ORTP_CFLAGS)
-AC_SUBST(ORTP_LIBS)
-
-AM_CONDITIONAL(EXTERNAL_ORTP, [test "$external_ortp" = 'true'])
-
-dnl Packaging: Pick oRTP version from ${top_srcdir}/oRTP/configure.ac
-dnl Feel free to propose an alternative & cleaner version...
-top_srcdir=`dirname $0`
-changequote(, )dnl
-ORTP_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/oRTP/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'`
-MS2_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/mediastreamer2/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'`
-changequote([, ])dnl
-AC_SUBST([ORTP_VERSION])
-AC_SUBST([MS2_VERSION])
-
-dnl ##################################################
-dnl # Check for doxygen
-dnl ##################################################
-
-AC_PATH_PROG(DOXYGEN,doxygen,false)
-AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
-
-
-AC_OUTPUT([ 
-Makefile 
-m4/Makefile
-po/Makefile.in 
-pixmaps/Makefile
-coreapi/Makefile
-coreapi/help/Makefile
-coreapi/help/Doxyfile
-coreapi/help/doxygen.dox
-gtk/Makefile
-console/Makefile
-share/Makefile
-share/C/Makefile
-share/fr/Makefile
-share/it/Makefile
-share/ja/Makefile
-share/cs/Makefile
-share/linphone.pc
-share/linphone.desktop
-scripts/Makefile
-linphone.spec
-linphone.iss
-])
-
-echo "Linphone build configuration ended."
-
-if test x$gtk_ui = xtrue ; then
-       echo "* GTK interface will be compiled."
-fi
-if test x$console_ui = xtrue ; then
-       echo "* Console interface will be compiled."
-fi
-
-echo "Now type 'make' to compile, and then 'make install' as root to install it."
index 70c2625b4bf82768627dac716c2e1f134b6cb2d2..bef1e90d1e917a36a0aea63bc527f594f37b045e 100644 (file)
@@ -9,9 +9,7 @@ INCLUDES = \
        -I$(top_srcdir)/coreapi\
        $(ORTP_CFLAGS) \
        -I$(top_srcdir)/exosip \
-       -I$(top_srcdir)/mediastreamer2/include
-
-
+       $(MEDIASTREAMER_CFLAGS)
 
 bin_PROGRAMS =  linphonec linphonecsh
 
@@ -22,7 +20,7 @@ endif
 linphonec_SOURCES = linphonec.c linphonec.h commands.c
 linphonec_CFLAGS=$(COMMON_CFLAGS) $(CONSOLE_FLAGS)
 linphonec_LDADD = $(top_builddir)/coreapi/liblinphone.la $(READLINE_LIBS)  \
-               $(top_builddir)/mediastreamer2/src/libmediastreamer.la \
+               $(MEDIASTREAMER_LIBS) \
                $(ORTP_LIBS) \
                $(SPEEX_LIBS) \
                $(OSIP_LIBS)
@@ -41,7 +39,7 @@ sipomatic_CFLAGS= $(COMMON_CFLAGS) $(CONSOLE_FLAGS)
 
 sipomatic_LDADD=       $(INTLLIBS)  \
                        $(top_builddir)/coreapi/liblinphone.la \
-                       $(top_builddir)/mediastreamer2/src/libmediastreamer.la \
+                       $(MEDIASTREAMER_LIBS) \
                        $(ORTP_LIBS) \
                        $(SPEEX_LIBS) \
                        $(OSIP_LIBS)
index 619746cda1ab53cc5a350f60fe579fbf1e448991..142ac833db24c97858a82aefa98ecad2267a4ea2 100644 (file)
@@ -89,8 +89,13 @@ static int lpc_cmd_resume(LinphoneCore *lc, char *args);
 static int lpc_cmd_mute_mic(LinphoneCore *lc, char *args);
 static int lpc_cmd_unmute_mic(LinphoneCore *lc, char *args);
 static int lpc_cmd_rtp_no_xmit_on_audio_mute(LinphoneCore *lc, char *args);
+#ifdef VIDEO_ENABLED
+static int lpc_cmd_camera(LinphoneCore *lc, char *args);
 static int lpc_cmd_video_window(LinphoneCore *lc, char *args);
+#endif
 static int lpc_cmd_states(LinphoneCore *lc, char *args);
+static int lpc_cmd_identify(LinphoneCore *lc, char *args);
+static int lpc_cmd_ringback(LinphoneCore *lc, char *args);
 
 /* Command handler helpers */
 static void linphonec_proxy_add(LinphoneCore *lc);
@@ -136,9 +141,12 @@ static LPC_COMMAND commands[] = {
                "'help <command>'\t: displays specific help for command.\n"
                "'help advanced'\t: shows advanced commands.\n"
        },
-       { "call", lpc_cmd_call, "Call a SIP uri",
-               "'call <sip-url>' \t: initiate a call to the specified destination.\n"
-               "'call show' \t: show all the current calls with their id and status.\n"
+       { "call", lpc_cmd_call, "Call a SIP uri or number",
+#ifdef VIDEO_ENABLED
+               "'call <sip-url or number>  [--audio-only]' \t: initiate a call to the specified destination.\n"
+#else
+               "'call <sip-url or number>' \t: initiate a call to the specified destination.\n"
+#endif
                },
        { "calls", lpc_cmd_calls, "Show all the current calls with their id and status.",
                NULL
@@ -163,6 +171,11 @@ static LPC_COMMAND commands[] = {
                "'resume <call id>' : hold off the call with given id\n"},
        { "mute", lpc_cmd_mute_mic, 
          "Mute microphone and suspend voice transmission."},
+#ifdef VIDEO_ENABLED
+       { "camera", lpc_cmd_camera, "Send camera output for current call.",
+               "'camera on'\t: allow sending of local camera video to remote end.\n"
+               "'camera off'\t: disable sending of local camera's video to remote end.\n"},
+#endif
        { "unmute", lpc_cmd_unmute_mic, 
                  "Unmute microphone and resume voice transmission."},
        { "duration", lpc_cmd_duration, "Print duration in seconds of the last call.", NULL },
@@ -255,12 +268,14 @@ static LPC_COMMAND advanced_commands[] = {
                  "Set the rtp_no_xmit_on_audio_mute configuration parameter",
                  "   If set to 1 then rtp transmission will be muted when\n"
                  "   audio is muted , otherwise rtp is always sent."}, 
+#ifdef VIDEO_ENABLED
        { "vwindow", lpc_cmd_video_window, "Control video display window",
                "'vwindow show': shows video window\n"
                "'vwindow hide': hides video window\n"
                "'vwindow pos <x> <y>': Moves video window to x,y pixel coordinates\n"
                "'vwindow size <width> <height>': Resizes video window"
        },
+#endif
        { "states", lpc_cmd_states, "Show internal states of liblinphone, registrations and calls, according to linphonecore.h definitions",
                "'states global': shows global state of liblinphone \n"
                "'states calls': shows state of calls\n"
@@ -284,6 +299,14 @@ static LPC_COMMAND advanced_commands[] = {
                "'staticpic set' : Set path to picture that should be used.\n"
                "'staticpic fps' : Get/set frames per seconds for picture emission.\n"
        },
+       { "identify", lpc_cmd_identify, "Returns the user-agent string of far end",
+               "'identify' \t: returns remote user-agent string for current call.\n"
+               "'identify <id>' \t: returns remote user-agent string for call with supplied id.\n"
+       },
+       { "ringback", lpc_cmd_ringback, "Specifies a ringback tone to be played to remote end during incoming calls",
+               "'ringback <path of mono .wav file>'\t: Specifies a ringback tone to be played to remote end during incoming calls\n"
+               "'ringback disable'\t: Disable playing of ringback tone to callers\n"
+       },
        {       NULL,NULL,NULL,NULL}
 };
 
@@ -503,12 +526,19 @@ lpc_cmd_call(LinphoneCore *lc, char *args)
        }
        {
                LinphoneCall *call;
+               LinphoneCallParams *cp=linphone_core_create_default_call_parameters (lc);
+               char *opt;
                if ( linphone_core_in_call(lc) )
                {
                        linphonec_out("Terminate or hold on the current call first.\n");
                        return 1;
                }
-               if ( NULL == (call=linphone_core_invite(lc, args)) )
+               opt=strstr(args,"--audio-only");
+               if (opt){
+                       opt[0]='\0';
+                       linphone_call_params_enable_video (cp,FALSE);
+               }
+               if ( NULL == (call=linphone_core_invite_with_params(lc, args,cp)) )
                {
                        linphonec_out("Error from linphone_core_invite.\n");
                }
@@ -516,6 +546,7 @@ lpc_cmd_call(LinphoneCore *lc, char *args)
                {
                        snprintf(callee_name,sizeof(callee_name),"%s",args);
                }
+               linphone_call_params_destroy(cp);
        }
        return 1;
 }
@@ -624,7 +655,7 @@ static int
 lpc_cmd_terminate(LinphoneCore *lc, char *args)
 {
        if (linphone_core_get_calls(lc)==NULL){
-               linphonec_out("No active calls");
+               linphonec_out("No active calls\n");
                return 1;
        }
        if (!args)
@@ -645,7 +676,7 @@ lpc_cmd_terminate(LinphoneCore *lc, char *args)
                LinphoneCall *call=linphonec_get_call(id);
                if (call){
                        if (linphone_core_terminate_call(lc,call)==-1){
-                               linphonec_out("Could not stop the call with id %li",id);
+                               linphonec_out("Could not stop the call with id %li\n",id);
                        }
                }else return 0;
                return 1;
@@ -1636,7 +1667,6 @@ linphonec_proxy_remove(LinphoneCore *lc, int index)
        }
        linphone_core_remove_proxy_config(lc,cfg);
        linphonec_out("Proxy %s removed.\n", cfg->reg_proxy);
-       linphone_proxy_config_destroy(cfg);
 }
 
 static int
@@ -2166,11 +2196,11 @@ static int lpc_cmd_rtp_no_xmit_on_audio_mute(LinphoneCore *lc, char *args)
        return 1;
 }
 
+#ifdef VIDEO_ENABLED
 static int lpc_cmd_video_window(LinphoneCore *lc, char *args){
        char subcommand[64];
        int a,b;
        int err;
-#ifdef VIDEO_ENABLED
        err=sscanf(args,"%s %i %i",subcommand,&a,&b);
        if (err>=1){
                if (strcmp(subcommand,"pos")==0){
@@ -2191,11 +2221,10 @@ static int lpc_cmd_video_window(LinphoneCore *lc, char *args){
                        lpc_video_params.refresh=TRUE;
                }else return 0;
        }
-#else
-       linphonec_out("Sorry, this version of linphonec wasn't compiled with video support.");
-#endif
+
        return 1;
 }
+#endif
 
 static void lpc_display_global_state(LinphoneCore *lc){
        linphonec_out("Global liblinphone state\n%s\n",
@@ -2261,6 +2290,90 @@ static int lpc_cmd_states(LinphoneCore *lc, char *args){
        return 0;
 }
 
+#ifdef VIDEO_ENABLED
+static int lpc_cmd_camera(LinphoneCore *lc, char *args){
+       LinphoneCall *call=linphone_core_get_current_call(lc);
+       bool_t activated=FALSE;
+       
+       if (linphone_core_video_enabled (lc)==FALSE){
+               linphonec_out("Video is disabled, re-run linphonec with -V option.");
+               return 1;
+       }
+
+       if (args){
+               if (strcmp(args,"on")==0)
+                       activated=TRUE;
+               else if (strcmp(args,"off")==0)
+                       activated=FALSE;
+               else
+                       return 0;
+       }
+
+       if (call==NULL){
+               if (args){
+                       linphonec_camera_enabled=activated;
+               }
+               if (linphonec_camera_enabled){
+                       linphonec_out("Camera is enabled. Video stream will be setup immediately for outgoing and incoming calls.\n");
+               }else{
+                       linphonec_out("Camera is disabled. Calls will be established with audio-only, with the possibility to later add video using 'camera on'.\n");
+               }
+       }else{
+               const LinphoneCallParams *cp=linphone_call_get_current_params (call);
+               if (args){
+                       linphone_call_enable_camera(call,activated);
+                       if ((activated && !linphone_call_params_video_enabled (cp))){
+                               /*update the call to add the video stream*/
+                               LinphoneCallParams *ncp=linphone_call_params_copy(cp);
+                               linphone_call_params_enable_video(ncp,TRUE);
+                               linphone_core_update_call(lc,call,ncp);
+                               linphone_call_params_destroy (ncp);
+                               linphonec_out("Trying to bring up video stream...\n");
+                       }
+               }
+               if (linphone_call_camera_enabled (call))
+                               linphonec_out("Camera is allowed for current call.\n");
+               else linphonec_out("Camera is dis-allowed for current call.\n");
+       }
+       return 1;
+}
+
+#endif
+
+static int lpc_cmd_identify(LinphoneCore *lc, char *args){
+       LinphoneCall *call;
+       const char *remote_ua;
+       if (args==NULL){
+               call=linphone_core_get_current_call(lc);
+               if (call==NULL) {
+                       linphonec_out("There is currently running call. Specify call id.\n");
+                       return 0;
+               }
+       }else{
+               call=linphonec_get_call(atoi(args));
+               if (call==NULL){
+                       return 0;
+               }
+       }
+       remote_ua=linphone_call_get_remote_user_agent(call);
+       if (remote_ua){
+               linphonec_out("Remote user agent string is: %s\n",remote_ua);
+       }
+       return 1;
+}
+
+static int lpc_cmd_ringback(LinphoneCore *lc, char *args){
+       if (!args) return 0;
+       if (strcmp(args,"disable")==0){
+               linphone_core_set_remote_ringback_tone(lc,NULL);
+               linphonec_out("Disabling ringback tone.\n");
+               return 1;
+       }
+       linphone_core_set_remote_ringback_tone (lc,args);
+       linphonec_out("Using %s as ringback tone to be played to callers.",args);
+       return 1;
+}
+
 /***************************************************************************
  *
  *  Command table management funx
index 6985287d67871794a5d8ed65ab7f230cc8f848e4..dbdf16594f72a55b38a0e2272decd682df832b28 100644 (file)
@@ -173,6 +173,8 @@ static bool_t pipe_reader_run=FALSE;
 static ortp_pipe_t server_sock;
 #endif /*_WIN32_WCE*/
 
+bool_t linphonec_camera_enabled=TRUE;
+
 
 extern VideoParams lpc_video_params;
 
@@ -313,6 +315,13 @@ linphonec_new_unknown_subscriber(LinphoneCore *lc, LinphoneFriend *lf,
 
 }
 
+static void linphonec_call_updated(LinphoneCall *call){
+       const LinphoneCallParams *cp=linphone_call_get_current_params(call);
+       if (!linphone_call_camera_enabled (call) && linphone_call_params_video_enabled (cp)){
+               linphonec_out("Far end requests to share video.\nType 'camera on' if you agree.");
+       }
+}
+
 static void linphonec_call_state_changed(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState st, const char *msg){
        char *from=linphone_call_get_remote_address_as_string(call);
        long id=(long)linphone_call_get_user_pointer (call);
@@ -337,6 +346,7 @@ static void linphonec_call_state_changed(LinphoneCore *lc, LinphoneCall *call, L
                break;
                case LinphoneCallIncomingReceived:
                        linphonec_call_identify(call);
+                       linphone_call_enable_camera (call,linphonec_camera_enabled);
                        id=(long)linphone_call_get_user_pointer (call);
                        linphonec_set_caller(from);
                        if ( auto_answer)  {
@@ -347,6 +357,9 @@ static void linphonec_call_state_changed(LinphoneCore *lc, LinphoneCall *call, L
                case LinphoneCallOutgoingInit:
                        linphonec_call_identify(call);
                break;
+               case LinphoneCallUpdatedByRemote:
+                       linphonec_call_updated(call);
+               break;
                default:
                break;
        }
@@ -734,7 +747,7 @@ linphonec_finish(int exit_status)
        {
                fclose (mylogfile);
        }
-
+       printf("\n");
        exit(exit_status);
 
 }
index 4a5844b56c4ab7859994a07eef28788b0d11d65a..5f91b1b50f9931342ec8bc7501e1e36f6c94c736 100644 (file)
@@ -121,6 +121,8 @@ void linphonec_set_caller(const char *caller);
 LinphoneCall *linphonec_get_call(long id);
 void linphonec_call_identify(LinphoneCall* call);
 
+extern bool_t linphonec_camera_enabled;
+
 #endif /* def LINPHONEC_H */
 
 /****************************************************************************
index b3cf6df1921b22c4b1e2e82298c7aa3b2cfc6a13..0e498053db8589da842674cda702719d54c53288 100644 (file)
@@ -10,7 +10,7 @@ linphone_include_HEADERS=linphonecore.h linphonecore_utils.h ../config.h lpconfi
 
 INCLUDES = \
        -I$(top_srcdir)\
-       -I$(top_srcdir)/mediastreamer2/include
+       $(MEDIASTREAMER_CFLAGS)
 
 
 lib_LTLIBRARIES=liblinphone.la
@@ -42,7 +42,7 @@ liblinphone_la_LDFLAGS= -version-info $(LIBLINPHONE_SO_VERSION) -no-undefined
 
 liblinphone_la_LIBADD= \
                $(EXOSIP_LIBS) \
-               $(top_builddir)/mediastreamer2/src/libmediastreamer.la \
+               $(MEDIASTREAMER_LIBS) \
                $(ORTP_LIBS)
 
 if BUILD_WIN32
@@ -53,11 +53,14 @@ noinst_PROGRAMS=test_lsd
 
 test_lsd_SOURCES=test_lsd.c
 
-test_lsd_LDADD=liblinphone.la
+test_lsd_LDADD=liblinphone.la \
+                                                       $(MEDIASTREAMER_LIBS) \
+                                                       $(ORTP_LIBS)
 
 AM_CFLAGS=$(STRICT_OPTIONS)  -DIN_LINPHONE \
        $(ORTP_CFLAGS) \
        $(OSIP_CFLAGS) \
+       $(MEDIASTREAMER_CFLAGS) \
        $(EXOSIP_CFLAGS) \
        -DENABLE_TRACE  \
        -DLOG_DOMAIN=\"LinphoneCore\" \
index 4d4b1d2d6ed9f48662f75774f2814c77391c74bb..7475ab59668cddca0ac97f9b0034500dd169758c 100644 (file)
@@ -129,6 +129,29 @@ char *linphone_address_as_string_uri_only(const LinphoneAddress *u){
        return sal_address_as_string_uri_only(u);
 }
 
+static bool_t strings_equals(const char *s1, const char *s2){
+       if (s1==NULL && s2==NULL) return TRUE;
+       if (s1!=NULL && s2!=NULL && strcmp(s1,s2)==0) return TRUE;
+       return FALSE;
+}
+
+/**
+ * Compare two LinphoneAddress ignoring tags and headers, basically just domain, username, and port.
+ * Returns TRUE if they are equal.
+**/
+bool_t linphone_address_weak_compare(const LinphoneAddress *a1, const LinphoneAddress *a2){
+       const char *u1,*u2;
+       const char *h1,*h2;
+       int p1,p2;
+       u1=linphone_address_get_username(a1);
+       u2=linphone_address_get_username(a2);
+       p1=linphone_address_get_port_int(a1);
+       p2=linphone_address_get_port_int(a2);
+       h1=linphone_address_get_domain(a1);
+       h2=linphone_address_get_domain(a2);
+       return strings_equals(u1,u2) && strings_equals(h1,h2) && p1==p2;
+}
+
 /**
  * Destroys a LinphoneAddress object.
 **/
@@ -139,6 +162,7 @@ void linphone_address_destroy(LinphoneAddress *u){
 int linphone_address_get_port_int(const LinphoneAddress *u) {
        return sal_address_get_port_int(u);
 }
+
 const char* linphone_address_get_port(const LinphoneAddress *u) {
        return sal_address_get_port(u);
 }
index 642e3d18808697d25904639b5fff727e5cf16793..53382eb275b3905989327ddf65b145e86d302bbe 100644 (file)
@@ -23,7 +23,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "linphonecore.h"
 #include "private.h"
 #include "mediastreamer2/mediastream.h"
+#include "lpconfig.h"
 
+static void register_failure(SalOp *op, SalError error, SalReason reason, const char *details);
 
 static void linphone_connect_incoming(LinphoneCore *lc, LinphoneCall *call){
        if (lc->ringstream!=NULL){
@@ -33,6 +35,18 @@ static void linphone_connect_incoming(LinphoneCore *lc, LinphoneCall *call){
        linphone_call_start_media_streams(call);
 }
 
+static bool_t is_duplicate_call(LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to){
+       MSList *elem;
+       for(elem=lc->calls;elem!=NULL;elem=elem->next){
+               LinphoneCall *call=(LinphoneCall*)elem->data;
+               if (linphone_address_weak_compare(call->log->from,from) &&
+                   linphone_address_weak_compare(call->log->to, to)){
+                       return TRUE;
+               }
+       }
+       return FALSE;
+}
+
 static void call_received(SalOp *h){
        LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(h));
        char *barmesg;
@@ -40,7 +54,9 @@ static void call_received(SalOp *h){
        const char *from,*to;
        char *tmp;
        LinphoneAddress *from_parsed;
-
+       LinphoneAddress *from_addr, *to_addr;
+       const char * early_media=linphone_core_get_remote_ringback_tone (lc);
+       
        /* first check if we can answer successfully to this invite */
        if (lc->presence_mode==LinphoneStatusBusy ||
            lc->presence_mode==LinphoneStatusOffline ||
@@ -64,9 +80,18 @@ static void call_received(SalOp *h){
        }
        from=sal_op_get_from(h);
        to=sal_op_get_to(h);
+       from_addr=linphone_address_new(from);
+       to_addr=linphone_address_new(to);
+
+       if (is_duplicate_call(lc,from_addr,to_addr)){
+               ms_warning("Receiving duplicated call, refusing this one.");
+               sal_call_decline(h,SalReasonBusy,NULL);
+               linphone_address_destroy(from_addr);
+               linphone_address_destroy(to_addr);
+               return;
+       }
        
-       call=linphone_call_new_incoming(lc,linphone_address_new(from),linphone_address_new(to),h);
-       
+       call=linphone_call_new_incoming(lc,from_addr,to_addr,h);
        sal_call_set_local_media_description(h,call->localdesc);
        call->resultdesc=sal_call_get_final_media_description(h);
        if (call->resultdesc)
@@ -76,14 +101,11 @@ static void call_received(SalOp *h){
                linphone_call_unref(call);
                return;
        }
+       
+       
        /* the call is acceptable so we can now add it to our list */
-       if(linphone_core_add_call(lc,call)!= 0)
-       {
-               ms_warning("we cannot handle anymore call\n");
-               sal_call_decline(h,SalReasonMedia,NULL);
-               linphone_call_unref(call);
-               return;
-       }
+       linphone_core_add_call(lc,call);
+       
        from_parsed=linphone_address_new(sal_op_get_from(h));
        linphone_address_clean(from_parsed);
        tmp=linphone_address_as_string(from_parsed);
@@ -115,9 +137,12 @@ static void call_received(SalOp *h){
        }else{
                /*TODO : play a tone within the context of the current call */
        }
-       sal_call_notify_ringing(h);
+       sal_call_notify_ringing(h,early_media!=NULL);
 #if !(__IPHONE_OS_VERSION_MIN_REQUIRED >= 40000)
        linphone_call_init_media_streams(call);
+       if (early_media!=NULL){
+               linphone_call_start_early_media (call);
+       }
 #endif
        ms_free(barmesg);
        ms_free(tmp);
@@ -301,6 +326,8 @@ static void call_updating(SalOp *op){
                        if (lc->current_call!=call){
                                ms_error("Inconsitency detected: current call is %p but call %p is being paused !",lc->current_call,call);
                        }
+               }else{
+                       linphone_call_set_state(call, LinphoneCallUpdatedByRemote,"Call updated by remote");
                }
                /*accept the modification (sends a 200Ok)*/
                sal_call_accept(op);
@@ -314,6 +341,8 @@ static void call_updating(SalOp *op){
 static void call_terminated(SalOp *op, const char *from){
        LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
        LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
+
+       if (call==NULL) return;
        
        if (linphone_call_get_state(call)==LinphoneCallEnd || linphone_call_get_state(call)==LinphoneCallError){
                ms_warning("call_terminated: ignoring.");
@@ -426,6 +455,9 @@ static void auth_requested(SalOp *h, const char *realm, const char *username){
                sal_op_authenticate(h,&sai);
                ai->usecount++;
        }else{
+               if (ai && ai->works==FALSE) {
+                       register_failure(h, SalErrorFailure, SalReasonForbidden, _("Authentication failure"));
+               } 
                if (lc->vtable.auth_info_requested)
                        lc->vtable.auth_info_requested(lc,realm,username);
        }
@@ -446,6 +478,7 @@ static void register_success(SalOp *op, bool_t registered){
        char *msg;
        
        cfg->registered=registered;
+       linphone_proxy_config_set_error(cfg,LinphoneErrorNone);
        linphone_proxy_config_set_state(cfg, registered ? LinphoneRegistrationOk : LinphoneRegistrationCleared ,
                                        registered ? "Registration sucessful" : "Unregistration done");
        if (lc->vtable.display_status){
@@ -473,6 +506,11 @@ static void register_failure(SalOp *op, SalError error, SalReason reason, const
                lc->vtable.display_status(lc,msg);
                ms_free(msg);
        }
+       if (error== SalErrorFailure && reason == SalReasonForbidden) {
+               linphone_proxy_config_set_error(cfg, LinphoneErrorBadCredentials);
+       } else if (error == SalErrorNoResponse) {
+               linphone_proxy_config_set_error(cfg, LinphoneErrorNoResponse);
+       }
        linphone_proxy_config_set_state(cfg,LinphoneRegistrationFailed,details);
 }
 
index ebe407ff9722abdf19ef02c35108ab66d64caafc..0cdd3f8f0aebea5916082f064ea88fe5f3b00f7e 100644 (file)
@@ -36,14 +36,17 @@ noinst_PROGRAMS=helloworld
 
 helloworld_SOURCES=helloworld.c
 
-helloworld_LDADD=$(top_builddir)/coreapi/liblinphone.la
+helloworld_LDADD=$(top_builddir)/coreapi/liblinphone.la \
+                               $(MEDIASTREAMER_LIBS) \
+                               $(ORTP_LIBS)
 
 INCLUDES=-I$(top_srcdir)/coreapi \
-               -I$(top_srcdir)/mediastreamer2/include
+               $(MEDIASTREAMER_CFLAGS)
 
 AM_CFLAGS=$(STRICT_OPTIONS)  -DIN_LINPHONE \
        $(ORTP_CFLAGS) \
        $(OSIP_CFLAGS) \
+       $(MEDIASTREAMER_CFLAGS) \
        $(EXOSIP_CFLAGS) \
        -DENABLE_TRACE  \
        -DLOG_DOMAIN=\"LinphoneCore\" \
index 812fa8cf7812b1580b1d1a2415a2a9347059c02e..f96b4ed747f613a0438c6d6acb94058d97ea7978 100644 (file)
@@ -30,7 +30,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "mediastreamer2/mediastream.h"
 #include "mediastreamer2/msvolume.h"
 #include "mediastreamer2/msequalizer.h"
+#include "mediastreamer2/msfileplayer.h"
 
+#ifdef VIDEO_ENABLED
+static MSWebCam *get_nowebcam_device(){
+       return ms_web_cam_manager_get_cam(ms_web_cam_manager_get(),"StaticImage: Static picture");
+}
+#endif
 
 
 static MSList *make_codec_list(LinphoneCore *lc, const MSList *codecs, bool_t only_one_codec){
@@ -46,11 +52,15 @@ static MSList *make_codec_list(LinphoneCore *lc, const MSList *codecs, bool_t on
        return l;
 }
 
-static SalMediaDescription *create_local_media_description(LinphoneCore *lc, 
-               LinphoneCall *call, const char *username, bool_t only_one_codec){
+SalMediaDescription *create_local_media_description(LinphoneCore *lc, 
+               LinphoneCall *call, bool_t with_video, bool_t only_one_codec){
        MSList *l;
        PayloadType *pt;
+       const char *me=linphone_core_get_identity(lc);
+       LinphoneAddress *addr=linphone_address_new(me);
+       const char *username=linphone_address_get_username (addr);
        SalMediaDescription *md=sal_media_description_new();
+
        md->nstreams=1;
        strncpy(md->addr,call->localip,sizeof(md->addr));
        strncpy(md->username,username,sizeof(md->username));
@@ -69,7 +79,7 @@ static SalMediaDescription *create_local_media_description(LinphoneCore *lc,
        if (lc->dw_audio_bw>0)
                md->streams[0].bandwidth=lc->dw_audio_bw;
 
-       if (linphone_core_video_enabled (lc)){
+       if (with_video){
                md->nstreams++;
                md->streams[1].port=call->video_port;
                md->streams[1].proto=SalProtoRtpAvp;
@@ -79,6 +89,7 @@ static SalMediaDescription *create_local_media_description(LinphoneCore *lc,
                if (lc->dw_video_bw)
                        md->streams[1].bandwidth=lc->dw_video_bw;
        }
+       linphone_address_destroy(addr);
        return md;
 }
 
@@ -134,7 +145,7 @@ static void discover_mtu(LinphoneCore *lc, const char *remote){
        }
 }
 
-LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to)
+LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, const LinphoneCallParams *params)
 {
        LinphoneCall *call=ms_new0(LinphoneCall,1);
        call->dir=LinphoneCallOutgoing;
@@ -143,8 +154,9 @@ LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddr
        call->core=lc;
        linphone_core_get_local_ip(lc,linphone_address_get_domain(to),call->localip);
        linphone_call_init_common(call,from,to);
-       call->localdesc=create_local_media_description (lc,call,
-               linphone_address_get_username(from),FALSE);
+       call->params=*params;
+       call->localdesc=create_local_media_description (lc,call,params->has_video,FALSE);
+       call->camera_active=params->has_video;
        if (linphone_core_get_firewall_policy(call->core)==LinphonePolicyUseStun)
                linphone_core_run_stun_tests(call->core,call);
        discover_mtu(lc,linphone_address_get_domain (to));
@@ -153,7 +165,6 @@ LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddr
 
 LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, SalOp *op){
        LinphoneCall *call=ms_new0(LinphoneCall,1);
-       LinphoneAddress *me=linphone_core_get_primary_contact_parsed(lc);
        char *to_str;
        char *from_str;
 
@@ -178,12 +189,13 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro
        linphone_address_clean(from);
        linphone_core_get_local_ip(lc,linphone_address_get_domain(from),call->localip);
        linphone_call_init_common(call, from, to);
+       call->params.has_video=linphone_core_video_enabled(lc);
        call->localdesc=create_local_media_description (lc,call,
-           linphone_address_get_username(me),lc->sip_conf.only_one_codec);
+                                 call->params.has_video,lc->sip_conf.only_one_codec);
+       call->camera_active=call->params.has_video;
        if (linphone_core_get_firewall_policy(call->core)==LinphonePolicyUseStun)
                linphone_core_run_stun_tests(call->core,call);
        discover_mtu(lc,linphone_address_get_domain(from));
-       linphone_address_destroy(me);
        return call;
 }
 
@@ -259,6 +271,8 @@ const char *linphone_call_state_to_string(LinphoneCallState cs){
                        return "LinphoneCallEnd";
                case LinphoneCallPausedByRemote:
                        return "LinphoneCallPausedByRemote";
+               case LinphoneCallUpdatedByRemote:
+                       return "LinphoneCallUpdatedByRemote";
        }
        return "undefined state";
 }
@@ -336,6 +350,13 @@ void linphone_call_unref(LinphoneCall *obj){
        }
 }
 
+/**
+ * Returns current parameters associated to the call.
+**/
+const LinphoneCallParams * linphone_call_get_current_params(const LinphoneCall *call){
+       return &call->params;
+}
+
 /**
  * Returns the remote address associated to this call
  *
@@ -398,10 +419,23 @@ const char *linphone_call_get_refer_to(const LinphoneCall *call){
        return call->refer_to;
 }
 
+/**
+ * Returns direction of the call (incoming or outgoing).
+**/
 LinphoneCallDir linphone_call_get_dir(const LinphoneCall *call){
        return call->log->dir;
 }
 
+/**
+ * Returns the far end's user agent description string, if available.
+**/
+const char *linphone_call_get_remote_user_agent(LinphoneCall *call){
+       if (call->op){
+               return sal_op_get_remote_ua (call->op);
+       }
+       return NULL;
+}
+
 /**
  * Returns true if this calls has received a transfer that has not been
  * executed yet.
@@ -422,6 +456,60 @@ int linphone_call_get_duration(const LinphoneCall *call){
        return time(NULL)-call->media_start_time;
 }
 
+/**
+ * Indicate whether camera input should be sent to remote end.
+**/
+void linphone_call_enable_camera (LinphoneCall *call, bool_t enable){
+#ifdef VIDEO_ENABLED
+       if (call->videostream!=NULL && call->videostream->ticker!=NULL){
+               LinphoneCore *lc=call->core;
+               MSWebCam *nowebcam=get_nowebcam_device();
+               if (call->camera_active!=enable && lc->video_conf.device!=nowebcam){
+                       video_stream_change_camera(call->videostream,
+                                    enable ? lc->video_conf.device : nowebcam);
+               }
+       }
+       call->camera_active=enable;
+#endif
+}
+
+/**
+ *
+**/
+bool_t linphone_call_camera_enabled (const LinphoneCall *call){
+       return call->camera_active;
+}
+
+/**
+ * 
+**/
+void linphone_call_params_enable_video(LinphoneCallParams *cp, bool_t enabled){
+       cp->has_video=enabled;
+}
+
+/**
+ *
+**/
+bool_t linphone_call_params_video_enabled(const LinphoneCallParams *cp){
+       return cp->has_video;
+}
+
+/**
+ *
+**/
+LinphoneCallParams * linphone_call_params_copy(const LinphoneCallParams *cp){
+       LinphoneCallParams *ncp=ms_new0(LinphoneCallParams,1);
+       memcpy(ncp,cp,sizeof(LinphoneCallParams));
+       return ncp;
+}
+
+/**
+ *
+**/
+void linphone_call_params_destroy(LinphoneCallParams *p){
+       ms_free(p);
+}
+
 /**
  * @}
 **/
@@ -621,7 +709,13 @@ static RtpProfile *make_profile(LinphoneCore *lc, const SalMediaDescription *md,
        return prof;
 }
 
-void linphone_call_start_media_streams(LinphoneCall *call){
+static void setup_ring_player(LinphoneCore *lc, LinphoneCall *call){
+       int pause_time=3000;
+       audio_stream_play(call->audiostream,lc->sound_conf.ringback_tone);
+       ms_filter_call_method(call->audiostream->soundread,MS_FILE_PLAYER_LOOP,&pause_time);
+}
+
+static void _linphone_call_start_media_streams(LinphoneCall *call, bool_t send_early_media){
        LinphoneCore *lc=call->core;
        LinphoneAddress *me=linphone_core_get_primary_contact_parsed(lc);
        const char *tool="linphone-" LINPHONE_VERSION;
@@ -660,10 +754,12 @@ void linphone_call_start_media_streams(LinphoneCall *call){
                                if (stream->port==0 || stream->dir==SalStreamRecvOnly){
                                        captcard=NULL;
                                        playfile=NULL;
-                               }else if (stream->dir==SalStreamSendOnly){
+                               }else if (stream->dir==SalStreamSendOnly || send_early_media){
                                        playcard=NULL;
                                        captcard=NULL;
                                        recfile=NULL;
+                                       if (send_early_media)
+                                               playfile=NULL;
                                }
                                /*if playfile are supplied don't use soundcards*/
                                if (lc->use_files) {
@@ -682,14 +778,15 @@ void linphone_call_start_media_streams(LinphoneCall *call){
                                        recfile,
                                        playcard,
                                        captcard,
-                                       linphone_core_echo_cancellation_enabled(lc));
+                                       send_early_media ? FALSE : linphone_core_echo_cancellation_enabled(lc));
                                post_configure_audio_streams(call);
+                               if (send_early_media) setup_ring_player(lc,call);
                                audio_stream_set_rtcp_information(call->audiostream, cname, tool);
                        }else ms_warning("No audio stream accepted ?");
                }
        }
 #ifdef VIDEO_ENABLED
-       {
+       if (!send_early_media){
                const SalStreamDescription *stream=sal_media_description_find_stream(call->resultdesc,
                                                        SalProtoRtpAvp,SalVideo);
                used_pt=-1;
@@ -705,12 +802,14 @@ void linphone_call_start_media_streams(LinphoneCall *call){
                                VideoStreamDir dir=VideoStreamSendRecv;
                                MSWebCam *cam=lc->video_conf.device;
                                bool_t is_inactive=FALSE;
+
+                               call->params.has_video=TRUE;
                                
                                video_stream_set_sent_video_size(call->videostream,linphone_core_get_preferred_video_size(lc));
                                video_stream_enable_self_view(call->videostream,lc->video_conf.selfview);
                                                
                                if (stream->dir==SalStreamSendOnly && lc->video_conf.capture ){
-                                       cam=ms_web_cam_manager_get_cam(ms_web_cam_manager_get(),"StaticImage: Static picture");
+                                       cam=get_nowebcam_device();
                                        dir=VideoStreamSendOnly;
                                }else if (stream->dir==SalStreamRecvOnly && lc->video_conf.display ){
                                        dir=VideoStreamRecvOnly;
@@ -726,6 +825,9 @@ void linphone_call_start_media_streams(LinphoneCall *call){
                                        /*either inactive or incompatible with local capabilities*/
                                        is_inactive=TRUE;
                                }
+                               if (call->camera_active==FALSE){
+                                       cam=get_nowebcam_device();
+                               }
                                if (!is_inactive){
                                        video_stream_set_direction (call->videostream, dir);
                                        video_stream_start(call->videostream,
@@ -747,6 +849,13 @@ void linphone_call_start_media_streams(LinphoneCall *call){
 }
 
 
+void linphone_call_start_media_streams(LinphoneCall *call){
+       _linphone_call_start_media_streams(call,FALSE);
+}
+
+void linphone_call_start_early_media(LinphoneCall *call){
+       _linphone_call_start_media_streams(call,TRUE);
+}
 
 static void linphone_call_log_fill_stats(LinphoneCallLog *log, AudioStream *st){
        audio_stream_get_local_rtp_stats (st,&log->local_stats);
@@ -777,4 +886,3 @@ void linphone_call_stop_media_streams(LinphoneCall *call){
        }
 }
 
-
index b35ea38d72362f67fce889ff2f5dc25c36a9804f..447f1ab0bfd29c765690095d701c9971e4dd65d1 100644 (file)
@@ -467,6 +467,8 @@ static void sound_config_read(LinphoneCore *lc)
 
        gain=lp_config_get_float(lc->config,"sound","playback_gain_db",0);
        linphone_core_set_playback_gain_db (lc,gain);
+
+       linphone_core_set_remote_ringback_tone (lc,lp_config_get_string(lc->config,"sound","ringback_tone",NULL));
 }
 
 static void sip_config_read(LinphoneCore *lc)
@@ -704,6 +706,17 @@ static MSList *add_missing_codecs(SalStreamType mtype, MSList *l){
        return l;
 }
 
+static MSList *codec_append_if_new(MSList *l, PayloadType *pt){
+       MSList *elem;
+       for (elem=l;l!=NULL;l=elem->next){
+               PayloadType *ept=(PayloadType*)elem->data;
+               if (pt==ept)
+                       return l;
+       }
+       l=ms_list_append(l,pt);
+       return l;
+}
+
 static void codecs_config_read(LinphoneCore *lc)
 {
        int i;
@@ -714,7 +727,7 @@ static void codecs_config_read(LinphoneCore *lc)
                if (pt){
                        if (!ms_filter_codec_supported(pt->mime_type)){
                                ms_warning("Codec %s is not supported by mediastreamer2, removed.",pt->mime_type);
-                       }else audio_codecs=ms_list_append(audio_codecs,pt);
+                       }else audio_codecs=codec_append_if_new(audio_codecs,pt);
                }
        }
        audio_codecs=add_missing_codecs(SalAudio,audio_codecs);
@@ -722,7 +735,7 @@ static void codecs_config_read(LinphoneCore *lc)
                if (pt){
                        if (!ms_filter_codec_supported(pt->mime_type)){
                                ms_warning("Codec %s is not supported by mediastreamer2, removed.",pt->mime_type);
-                       }else video_codecs=ms_list_append(video_codecs,(void *)pt);
+                       }else video_codecs=codec_append_if_new(video_codecs,(void *)pt);
                }
        }
        video_codecs=add_missing_codecs(SalVideo,video_codecs);
@@ -1792,7 +1805,7 @@ LinphoneAddress * linphone_core_interpret_url(LinphoneCore *lc, const char *url)
 /**
  * Returns the default identity SIP address.
  *
- * @ingroup proxiesb
+ * @ingroup proxies
  * This is an helper function:
  *
  * If no default proxy is set, this will return the primary contact (
@@ -1965,12 +1978,39 @@ int linphone_core_start_invite(LinphoneCore *lc, LinphoneCall *call, LinphonePro
  * @ingroup call_control
  * @param lc the LinphoneCore object
  * @param url the destination of the call (sip address, or phone number).
+ *
+ * The application doesn't own a reference to the returned LinphoneCall object.
+ * Use linphone_call_ref() to safely keep the LinphoneCall pointer valid within your application.
+ *
+ * @Returns a LinphoneCall object or NULL in case of failure
 **/
 LinphoneCall * linphone_core_invite(LinphoneCore *lc, const char *url){
+       LinphoneCall *call;
+       LinphoneCallParams *p=linphone_core_create_default_call_parameters (lc);
+       call=linphone_core_invite_with_params(lc,url,p);
+       linphone_call_params_destroy(p);
+       return call;
+}
+
+
+/**
+ * Initiates an outgoing call according to supplied call parameters
+ *
+ * @ingroup call_control
+ * @param lc the LinphoneCore object
+ * @param url the destination of the call (sip address, or phone number).
+ * @param p call parameters
+ *
+ * The application doesn't own a reference to the returned LinphoneCall object.
+ * Use linphone_call_ref() to safely keep the LinphoneCall pointer valid within your application.
+ *
+ * @Returns a LinphoneCall object or NULL in case of failure
+**/
+LinphoneCall * linphone_core_invite_with_params(LinphoneCore *lc, const char *url, const LinphoneCallParams *p){
        LinphoneAddress *addr=linphone_core_interpret_url(lc,url);
        if (addr){
                LinphoneCall *call;
-               call=linphone_core_invite_address(lc,addr);
+               call=linphone_core_invite_address_with_params(lc,addr,p);
                linphone_address_destroy(addr);
                return call;
        }
@@ -1982,12 +2022,40 @@ LinphoneCall * linphone_core_invite(LinphoneCore *lc, const char *url){
  *
  * @ingroup call_control
  * @param lc the LinphoneCore object
- * @param real_parsed_url the destination of the call (sip address).
+ * @param addr the destination of the call (sip address).
  * 
  * The LinphoneAddress can be constructed directly using linphone_address_new(), or
  * created by linphone_core_interpret_url().
+ * The application doesn't own a reference to the returned LinphoneCall object.
+ * Use linphone_call_ref() to safely keep the LinphoneCall pointer valid within your application.
+ *
+ * @Returns a LinphoneCall object or NULL in case of failure
 **/
-LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, const LinphoneAddress *real_parsed_url)
+LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, const LinphoneAddress *addr){
+       LinphoneCall *call;
+       LinphoneCallParams *p=linphone_core_create_default_call_parameters (lc);
+       call=linphone_core_invite_address_with_params (lc,addr,p);
+       linphone_call_params_destroy(p);
+       return call;
+}
+
+
+/**
+ * Initiates an outgoing call given a destination LinphoneAddress
+ *
+ * @ingroup call_control
+ * @param lc the LinphoneCore object
+ * @param addr the destination of the call (sip address).
+       @param params call parameters
+ * 
+ * The LinphoneAddress can be constructed directly using linphone_address_new(), or
+ * created by linphone_core_interpret_url().
+ * The application doesn't own a reference to the returned LinphoneCall object.
+ * Use linphone_call_ref() to safely keep the LinphoneCall pointer valid within your application.
+ *
+ * @Returns a LinphoneCall object or NULL in case of failure
+**/
+LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const LinphoneAddress *addr, const LinphoneCallParams *params)
 {
        int err=0;
        const char *route=NULL;
@@ -2011,8 +2079,8 @@ LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, const LinphoneAddr
        linphone_core_get_default_proxy(lc,&proxy);
        route=linphone_core_get_route(lc);
        
-       real_url=linphone_address_as_string(real_parsed_url);
-       dest_proxy=linphone_core_lookup_known_proxy(lc,real_parsed_url);
+       real_url=linphone_address_as_string(addr);
+       dest_proxy=linphone_core_lookup_known_proxy(lc,addr);
 
        if (proxy!=dest_proxy && dest_proxy!=NULL) {
                ms_message("Overriding default proxy setting for this call:");
@@ -2029,7 +2097,7 @@ LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, const LinphoneAddr
 
        parsed_url2=linphone_address_new(from);
 
-       call=linphone_call_new_outgoing(lc,parsed_url2,linphone_address_clone(real_parsed_url));
+       call=linphone_call_new_outgoing(lc,parsed_url2,linphone_address_clone(addr),params);
        sal_op_set_route(call->op,route);
        
        if(linphone_core_add_call(lc,call)!= 0)
@@ -2092,6 +2160,27 @@ bool_t linphone_core_inc_invite_pending(LinphoneCore*lc){
        return FALSE;
 }
 
+/**
+ * Updates a running call according to supplied call parameters.
+ *
+ * For the moment, this is limited to enabling or disabling the video stream.
+ *
+ * @Returns 0 if successful, -1 otherwise.
+**/
+int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, LinphoneCallParams *params){
+       int err;
+       
+       if (call->localdesc)
+               sal_media_description_unref(call->localdesc);
+       call->localdesc=create_local_media_description (lc,call,
+               params->has_video,FALSE);
+       if (lc->vtable.display_status)
+               lc->vtable.display_status(lc,_("Modifying call parameters..."));
+       sal_call_set_local_media_description (call->op,call->localdesc);
+       err=sal_call_update(call->op);
+       return err;
+}
+
 
 /**
  * Accept an incoming call.
@@ -2156,6 +2245,12 @@ int linphone_core_accept_call(LinphoneCore *lc, LinphoneCall *call)
                sal_op_set_contact(call->op,contact);
 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000
        linphone_call_init_media_streams(call);
+#else
+       if (call->audiostream!=NULL && call->audiostream->ticker!=NULL){
+               /*case where we sent early media*/
+               linphone_call_stop_media_streams (call);
+               linphone_call_init_media_streams (call);
+       }
 #endif
        sal_call_accept(call->op);
        if (lc->vtable.display_status!=NULL)
@@ -3392,7 +3487,8 @@ void linphone_core_play_dtmf(LinphoneCore *lc, char dtmf, int duration_ms){
 **/
 void linphone_core_stop_dtmf(LinphoneCore *lc){
        MSFilter *f=get_dtmf_gen(lc);
-       ms_filter_call_method_noarg (f, MS_DTMF_GEN_STOP);
+       if (f!=NULL)
+               ms_filter_call_method_noarg (f, MS_DTMF_GEN_STOP);
 }
 
 
@@ -3786,6 +3882,25 @@ int linphone_core_del_call( LinphoneCore *lc, LinphoneCall *call)
        return 0;
 }
 
+/**
+ * Specifiies a ring back tone to be played to far end during incoming calls.
+**/
+void linphone_core_set_remote_ringback_tone(LinphoneCore *lc, const char *file){
+       if (lc->sound_conf.ringback_tone){
+               ms_free(lc->sound_conf.ringback_tone);
+               lc->sound_conf.ringback_tone=NULL;
+       }
+       if (file)
+               lc->sound_conf.ringback_tone=ms_strdup(file);
+}
+
+/**
+ * Returns the ring back tone played to far end during incoming calls.
+**/
+const char *linphone_core_get_remote_ringback_tone(const LinphoneCore *lc){
+       return lc->sound_conf.ringback_tone;
+}
+
 static PayloadType* find_payload_type_from_list(const char* type, int rate,const MSList* from) {
        const MSList *elem;
        for(elem=from;elem!=NULL;elem=elem->next){
@@ -3838,3 +3953,21 @@ const char *linphone_global_state_to_string(LinphoneGlobalState gs){
 LinphoneGlobalState linphone_core_get_global_state(const LinphoneCore *lc){
        return lc->state;
 }
+
+LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *lc){
+       LinphoneCallParams *p=ms_new0(LinphoneCallParams,1);
+       p->has_video=linphone_core_video_enabled(lc);
+       return p;
+}
+
+const char *linphone_error_to_string(LinphoneError err){
+       switch(err){
+               case LinphoneErrorNone:
+                       return "No error";
+               case LinphoneErrorNoResponse:
+                       return "No response";
+               case LinphoneErrorBadCredentials:
+                       return "Bad credentials";
+       }
+       return "unknown error";
+}
index f577ae9859163357f18dd8e50aa2fae75c677445..f536bdd71fc32efab6ef70ac39252cf9a7f5aceb 100644 (file)
@@ -93,6 +93,7 @@ void linphone_address_set_port_int(LinphoneAddress *uri, int port);
 void linphone_address_clean(LinphoneAddress *uri);
 char *linphone_address_as_string(const LinphoneAddress *u);
 char *linphone_address_as_string_uri_only(const LinphoneAddress *u);
+bool_t linphone_address_weak_compare(const LinphoneAddress *a1, const LinphoneAddress *a2);
 void linphone_address_destroy(LinphoneAddress *u);
 
 struct _SipSetupContext;
@@ -155,6 +156,32 @@ const rtp_stats_t *linphone_call_log_get_remote_stats(const LinphoneCallLog *cl)
 char * linphone_call_log_to_str(LinphoneCallLog *cl);
 
 
+/**
+ * The LinphoneCallParams is an object contaning various call related parameters.
+ * It can be used to retrieve parameters from a currently running call or modify the call's characterisitcs 
+ * dynamically.
+**/
+struct _LinphoneCallParams;
+typedef struct _LinphoneCallParams LinphoneCallParams;
+
+LinphoneCallParams * linphone_call_params_copy(const LinphoneCallParams *cp);
+void linphone_call_params_enable_video(LinphoneCallParams *cp, bool_t enabled);
+bool_t linphone_call_params_video_enabled(const LinphoneCallParams *cp);
+void linphone_call_params_destroy(LinphoneCallParams *cp);
+
+/**
+ * Enum describing failure reasons.
+**/
+enum _LinphoneError{
+       LinphoneErrorNone,
+       LinphoneErrorNoResponse, /**<No response received from remote*/
+       LinphoneErrorBadCredentials /**<Authentication failed due to bad or missing credentials*/
+};
+
+typedef enum _LinphoneError LinphoneError;
+
+const char *linphone_error_to_string(LinphoneError err);
+
 /**
  * The LinphoneCall object represents a call issued or received by the LinphoneCore
 **/
@@ -176,7 +203,8 @@ typedef enum _LinphoneCallState{
        LinphoneCallRefered,
        LinphoneCallError,
        LinphoneCallEnd,
-       LinphoneCallPausedByRemote
+       LinphoneCallPausedByRemote,
+       LinphoneCallUpdatedByRemote /**<used when video is asked by remote */
 } LinphoneCallState;
 
 const char *linphone_call_state_to_string(LinphoneCallState cs);
@@ -194,6 +222,11 @@ LinphoneCallLog *linphone_call_get_call_log(const LinphoneCall *call);
 const char *linphone_call_get_refer_to(const LinphoneCall *call);
 bool_t linphone_call_has_transfer_pending(const LinphoneCall *call);
 int linphone_call_get_duration(const LinphoneCall *call);
+const LinphoneCallParams * linphone_call_get_current_params(const LinphoneCall *call);
+void linphone_call_enable_camera(LinphoneCall *lc, bool_t enabled);
+bool_t linphone_call_camera_enabled(const LinphoneCall *lc);
+LinphoneError linphone_call_get_error(const LinphoneCall *call);
+const char *linphone_call_get_remote_user_agent(LinphoneCall *call);
 void *linphone_call_get_user_pointer(LinphoneCall *call);
 void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer);
 
@@ -308,6 +341,8 @@ struct _LinphoneCore * linphone_proxy_config_get_core(const LinphoneProxyConfig
 bool_t linphone_proxy_config_get_dial_escape_plus(const LinphoneProxyConfig *cfg);
 const char * linphone_proxy_config_get_dial_prefix(const LinphoneProxyConfig *cfg);
 
+LinphoneError linphone_proxy_config_get_error(const LinphoneProxyConfig *cfg);
+
 /* destruction is called automatically when removing the proxy config */
 void linphone_proxy_config_destroy(LinphoneProxyConfig *cfg);
 void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const char *type);
@@ -522,6 +557,10 @@ LinphoneCall * linphone_core_invite(LinphoneCore *lc, const char *url);
 
 LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, const LinphoneAddress *addr);
 
+LinphoneCall * linphone_core_invite_with_params(LinphoneCore *lc, const char *url, const LinphoneCallParams *params);
+
+LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const LinphoneAddress *addr, const LinphoneCallParams *params);
+
 int linphone_core_transfer_call(LinphoneCore *lc, LinphoneCall *call, const char *refer_to);
 
 bool_t linphone_core_inc_invite_pending(LinphoneCore*lc);
@@ -542,6 +581,10 @@ int linphone_core_pause_all_calls(LinphoneCore *lc);
 
 int linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *call);
 
+int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, LinphoneCallParams *params);
+
+LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *lc);
+
 LinphoneCall *linphone_core_get_call_by_remote_address(LinphoneCore *lc, const char *remote_address);
 
 void linphone_core_send_dtmf(LinphoneCore *lc,char dtmf);
@@ -550,6 +593,8 @@ int linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact);
 
 const char *linphone_core_get_primary_contact(LinphoneCore *lc);
 
+const char * linphone_core_get_identity(LinphoneCore *lc);
+
 void linphone_core_set_guess_hostname(LinphoneCore *lc, bool_t val);
 bool_t linphone_core_get_guess_hostname(LinphoneCore *lc);
 
@@ -557,7 +602,7 @@ bool_t linphone_core_ipv6_enabled(LinphoneCore *lc);
 void linphone_core_enable_ipv6(LinphoneCore *lc, bool_t val);
 
 LinphoneAddress *linphone_core_get_primary_contact_parsed(LinphoneCore *lc);
-
+const char * linphone_core_get_identity(LinphoneCore *lc);
 /*0= no bandwidth limit*/
 void linphone_core_set_download_bandwidth(LinphoneCore *lc, int bw);
 void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw);
@@ -702,6 +747,8 @@ void linphone_core_set_ring(LinphoneCore *lc, const char *path);
 const char *linphone_core_get_ring(const LinphoneCore *lc);
 void linphone_core_set_ringback(LinphoneCore *lc, const char *path);
 const char * linphone_core_get_ringback(const LinphoneCore *lc);
+void linphone_core_set_remote_ringback_tone(LinphoneCore *lc,const char *);
+const char *linphone_core_get_remote_ringback_tone(const LinphoneCore *lc);
 int linphone_core_preview_ring(LinphoneCore *lc, const char *ring,LinphoneCoreCbFunc func,void * userdata);
 void linphone_core_enable_echo_cancellation(LinphoneCore *lc, bool_t val);
 bool_t linphone_core_echo_cancellation_enabled(LinphoneCore *lc);
@@ -792,7 +839,7 @@ void linphone_core_stop_dtmf(LinphoneCore *lc);
 
 
 int linphone_core_get_current_call_duration(const LinphoneCore *lc);
-const LinphoneAddress *linphone_core_get_remote_address(LinphoneCore *lc);
+
 
 int linphone_core_get_mtu(const LinphoneCore *lc);
 void linphone_core_set_mtu(LinphoneCore *lc, int mtu);
index ac5ea1d7a9ff2f2a3a2db8686c9368d6434e6530..baf84287ad8387535823b09b5ab67ed7323b35d0 100644 (file)
@@ -168,7 +168,7 @@ int offer_answer_initiate_outgoing(const SalMediaDescription *local_offer,
     for(i=0,j=0;i<local_offer->nstreams;++i){
                ms_message("Processing for stream %i",i);
                ls=&local_offer->streams[i];
-               rs=sal_media_description_find_stream(remote_answer,ls->proto,ls->type);
+               rs=sal_media_description_find_stream((SalMediaDescription*)remote_answer,ls->proto,ls->type);
        if (rs) {
                        initiate_outgoing(ls,rs,&result->streams[j]);
                        ++j;
@@ -194,7 +194,7 @@ int offer_answer_initiate_incoming(const SalMediaDescription *local_capabilities
     for(i=0,j=0;i<remote_offer->nstreams;++i){
                rs=&remote_offer->streams[i];
                ms_message("Processing for stream %i",i);
-               ls=sal_media_description_find_stream(local_capabilities,rs->proto,rs->type);
+               ls=sal_media_description_find_stream((SalMediaDescription*)local_capabilities,rs->proto,rs->type);
                if (ls){
                initiate_incoming(ls,rs,&result->streams[j]);
                        ++j;
index b9e33b049081825f5634d81ce48fc1cf4772c312..c233515959ff50e95a46abd5d8c2987b8f785cb5 100644 (file)
 #endif
 #endif
 
+
+struct _LinphoneCallParams{
+       bool_t has_video;
+       bool_t pad[3];
+};
+
 struct _LinphoneCall
 {
        struct _LinphoneCore *core;
@@ -76,12 +82,15 @@ struct _LinphoneCall
        struct _AudioStream *audiostream;  /**/
        struct _VideoStream *videostream;
        char *refer_to;
+       LinphoneCallParams params;
        bool_t refer_pending;
        bool_t media_pending;
        bool_t audio_muted;
+       bool_t camera_active;
 };
 
-LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to);
+
+LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, const LinphoneCallParams *params);
 LinphoneCall * linphone_call_new_incoming(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, SalOp *op);
 void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const char *message);
 
@@ -174,7 +183,7 @@ void linphone_core_text_received(LinphoneCore *lc, const char *from, const char
 
 void linphone_call_init_media_streams(LinphoneCall *call);
 void linphone_call_start_media_streams(LinphoneCall *call);
-void linphone_call_set_media_streams_dir(LinphoneCall *call, SalStreamDir dir);
+void linphone_call_start_early_media(LinphoneCall *call);
 void linphone_call_stop_media_streams(LinphoneCall *call);
 
 const char * linphone_core_get_identity(LinphoneCore *lc);
@@ -187,7 +196,7 @@ void linphone_core_stop_waiting(LinphoneCore *lc);
 int linphone_core_start_invite(LinphoneCore *lc, LinphoneCall *call, LinphoneProxyConfig *dest_proxy);
 void linphone_core_start_pending_refered_calls(LinphoneCore *lc);
 extern SalCallbacks linphone_sal_callbacks;
-
+void linphone_proxy_config_set_error(LinphoneProxyConfig *cfg,LinphoneError error);
 
 struct _LinphoneProxyConfig
 {
@@ -211,6 +220,7 @@ struct _LinphoneProxyConfig
        bool_t dial_escape_plus;
        void* user_data;
        time_t deletion_date;
+       LinphoneError error;
 };
 
 struct _LinphoneAuthInfo 
@@ -310,6 +320,7 @@ typedef struct sound_config
        char source;
        char *local_ring;
        char *remote_ring;
+       char *ringback_tone;
        bool_t ec;
        bool_t ea;
        bool_t agc;
@@ -414,6 +425,9 @@ int linphone_core_get_calls_nb(const LinphoneCore *lc);
 
 void linphone_core_set_state(LinphoneCore *lc, LinphoneGlobalState gstate, const char *message);
 
+SalMediaDescription *create_local_media_description(LinphoneCore *lc, 
+               LinphoneCall *call, bool_t with_video, bool_t only_one_codec);
+
 #define HOLD_OFF       (0)
 #define HOLD_ON                (1)
 
index 251bdbb13c1c390e25dfbf23c3b79cd41bd11791..07a8e6c81527b32bcc58ecb8efd95c1ff11f2b22 100644 (file)
@@ -829,5 +829,11 @@ LinphoneRegistrationState linphone_proxy_config_get_state(const LinphoneProxyCon
         }
         return NULL;
  }
+LinphoneError linphone_proxy_config_get_error(const LinphoneProxyConfig *cfg) {
+       return cfg->error;
+}
+void linphone_proxy_config_set_error(LinphoneProxyConfig *cfg,LinphoneError error) {
+       cfg->error = error;
+}
 
 
index ca5b4d815bada807207bf77bf5e9e306f156757d..ac44470a60ce3ba377f6e597e1bd66c0f85c9526 100644 (file)
@@ -52,11 +52,11 @@ void sal_media_description_unref(SalMediaDescription *md){
        }
 }
 
-const SalStreamDescription *sal_media_description_find_stream(const SalMediaDescription *md,
+SalStreamDescription *sal_media_description_find_stream(SalMediaDescription *md,
     SalMediaProto proto, SalStreamType type){
        int i;
        for(i=0;i<md->nstreams;++i){
-               const SalStreamDescription *ss=&md->streams[i];
+               SalStreamDescription *ss=&md->streams[i];
                if (ss->proto==proto && ss->type==type) return ss;
        }
        return NULL;
@@ -143,6 +143,10 @@ const char *sal_op_get_route(const SalOp *op){
        return ((SalOpBase*)op)->route;
 }
 
+const char *sal_op_get_remote_ua(const SalOp *op){
+       return ((SalOpBase*)op)->remote_ua;
+}
+
 void *sal_op_get_user_pointer(const SalOp *op){
        return ((SalOpBase*)op)->user_pointer;
 }
@@ -187,6 +191,10 @@ void __sal_op_free(SalOp *op){
                ms_free(b->origin);
                b->origin=NULL;
        }
+       if (b->remote_ua){
+               ms_free(b->remote_ua);
+               b->remote_ua=NULL;
+       }
        if (b->local_media)
                sal_media_description_unref(b->local_media);
        if (b->remote_media)
index 7c6c7867bb545451d0dcbd475b2d0f74620868a4..9f97c52391a7e92a0af6b6e4bd7e120f60ce13b2 100644 (file)
@@ -128,7 +128,7 @@ void sal_media_description_ref(SalMediaDescription *md);
 void sal_media_description_unref(SalMediaDescription *md);
 bool_t sal_media_description_empty(const SalMediaDescription *md);
 bool_t sal_media_description_has_dir(const SalMediaDescription *md, SalStreamDir dir);
-const SalStreamDescription *sal_media_description_find_stream(const SalMediaDescription *md,
+SalStreamDescription *sal_media_description_find_stream(SalMediaDescription *md,
     SalMediaProto proto, SalStreamType type);
 void sal_media_description_set_dir(SalMediaDescription *md, SalStreamDir stream_dir);
 
@@ -140,6 +140,7 @@ typedef struct SalOpBase{
        char *from;
        char *to;
        char *origin;
+       char *remote_ua;
        SalMediaDescription *local_media;
        SalMediaDescription *remote_media;
        void *user_pointer;
@@ -267,16 +268,19 @@ const char *sal_op_get_route(const SalOp *op);
 const char *sal_op_get_proxy(const SalOp *op);
 /*for incoming requests, returns the origin of the packet as a sip uri*/
 const char *sal_op_get_network_origin(const SalOp *op);
+/*returns far-end "User-Agent" string */
+const char *sal_op_get_remote_ua(const SalOp *op);
 void *sal_op_get_user_pointer(const SalOp *op);
 
 /*Call API*/
 int sal_call_set_local_media_description(SalOp *h, SalMediaDescription *desc);
 int sal_call(SalOp *h, const char *from, const char *to);
-int sal_call_notify_ringing(SalOp *h);
+int sal_call_notify_ringing(SalOp *h, bool_t early_media);
 /*accept an incoming call or, during a call accept a reINVITE*/
 int sal_call_accept(SalOp*h);
 int sal_call_decline(SalOp *h, SalReason reason, const char *redirection /*optional*/);
 int sal_call_hold(SalOp *h, bool_t holdon);
+int sal_call_update(SalOp *h);
 SalMediaDescription * sal_call_get_final_media_description(SalOp *h);
 int sal_refer(SalOp *h, const char *refer_to);
 int sal_refer_accept(SalOp *h);
index 749bfce6b6fea9497e95a891df8aef413990a9b0..428e6aed3b9b003d7abb7c1e1c827b858d10dbb8 100644 (file)
@@ -503,10 +503,31 @@ int sal_call(SalOp *h, const char *from, const char *to){
        return 0;
 }
 
-int sal_call_notify_ringing(SalOp *h){
-       eXosip_lock();
-       eXosip_call_send_answer(h->tid,180,NULL);
-       eXosip_unlock();
+int sal_call_notify_ringing(SalOp *h, bool_t early_media){
+       osip_message_t *msg;
+       int err;
+       
+       /*if early media send also 180 and 183 */
+       if (early_media && h->sdp_answer){
+               msg=NULL;
+               eXosip_lock();
+               err=eXosip_call_build_answer(h->tid,180,&msg);
+               if (msg){
+                       set_sdp(msg,h->sdp_answer);
+                       eXosip_call_send_answer(h->tid,180,msg);
+               }
+               msg=NULL;
+               err=eXosip_call_build_answer(h->tid,183,&msg);
+               if (msg){
+                       set_sdp(msg,h->sdp_answer);
+                       eXosip_call_send_answer(h->tid,183,msg);
+               }
+               eXosip_unlock();
+       }else{
+               eXosip_lock();
+               eXosip_call_send_answer(h->tid,180,NULL);
+               eXosip_unlock();
+       }
        return 0;
 }
 
@@ -701,6 +722,16 @@ static void set_network_origin(SalOp *op, osip_message_t *req){
        __sal_op_set_network_origin(op,origin);
 }
 
+static void set_remote_ua(SalOp* op, osip_message_t *req){
+       if (op->base.remote_ua==NULL){
+               osip_header_t *h=NULL;
+               osip_message_get_user_agent(req,0,&h);
+               if (h){
+                       op->base.remote_ua=ms_strdup(h->hvalue);
+               }
+       }
+}
+
 static SalOp *find_op(Sal *sal, eXosip_event_t *ev){
        if (ev->cid>0){
                return sal_find_call(sal,ev->cid);
@@ -720,6 +751,7 @@ static void inc_new_call(Sal *sal, eXosip_event_t *ev){
        sdp_message_t *sdp=eXosip_get_sdp_info(ev->request);
 
        set_network_origin(op,ev->request);
+       set_remote_ua(op,ev->request);
        
        if (sdp){
                op->sdp_offering=FALSE;
@@ -865,7 +897,8 @@ static void call_ringing(Sal *sal, eXosip_event_t *ev){
        sdp_message_t *sdp;
        SalOp *op=find_op(sal,ev);
        if (call_proceeding(sal, ev)==-1) return;
-       
+
+       set_remote_ua(op,ev->response);
        sdp=eXosip_get_sdp_info(ev->response);
        if (sdp){
                op->base.remote_media=sal_media_description_new();
@@ -888,7 +921,8 @@ static void call_accepted(Sal *sal, eXosip_event_t *ev){
        }
 
        op->did=ev->did;
-       
+       set_remote_ua(op,ev->response);
+
        sdp=eXosip_get_sdp_info(ev->response);
        if (sdp){
                op->base.remote_media=sal_media_description_new();
@@ -1771,10 +1805,12 @@ void sal_set_keepalive_period(Sal *ctx,unsigned int value) {
        ctx->keepalive_period=value;
        eXosip_set_option (EXOSIP_OPT_UDP_KEEP_ALIVE, &value);
 }
+
 const char * sal_address_get_port(const SalAddress *addr) {
        const osip_from_t *u=(const osip_from_t*)addr;
        return null_if_empty(u->url->port);
 }
+
 int sal_address_get_port_int(const SalAddress *uri) {
        const char* port = sal_address_get_port(uri);
        if (port != NULL) {
@@ -1813,3 +1849,29 @@ int sal_call_hold(SalOp *h, bool_t holdon)
        return err;
 }
 
+/* sends a reinvite. Local media description may have changed by application since call establishment*/
+int sal_call_update(SalOp *h){
+       int err=0;
+       osip_message_t *reinvite=NULL;
+
+       eXosip_lock();
+       if(eXosip_call_build_request(h->did,"INVITE",&reinvite) != OSIP_SUCCESS || reinvite==NULL){
+               eXosip_unlock();
+               return -1;
+       }
+       eXosip_unlock();
+       osip_message_set_subject(reinvite,osip_strdup("Phone call parameters updated"));
+       osip_message_set_allow(reinvite, "INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO");
+       if (h->base.root->session_expires!=0){
+               osip_message_set_header(reinvite, "Session-expires", "200");
+               osip_message_set_supported(reinvite, "timer");
+       }
+       if (h->base.local_media){
+               h->sdp_offering=TRUE;
+               set_sdp_from_desc(reinvite,h->base.local_media);
+       }else h->sdp_offering=FALSE;
+       eXosip_lock();
+       err = eXosip_call_send_request(h->did, reinvite);
+       eXosip_unlock();
+       return err;
+}
index 546e9f4943a582bff046a442b50d1bda48a0d7ea..a2c38b342abe92aa482aa0c952f1943359676bcd 100644 (file)
@@ -45,8 +45,8 @@ linphone_3_SOURCES=   \
                        loginframe.c \
                        linphone.h 
 
-linphone_3_LDADD=$(top_builddir)/oRTP/src/libortp.la \
-               $(top_builddir)/mediastreamer2/src/libmediastreamer.la \
+linphone_3_LDADD=$(ORTP_LIBS) \
+               $(MEDIASTREAMER_LIBS) \
                $(top_builddir)/coreapi/liblinphone.la \
                        $(LIBGTK_LIBS) $(INTLLIBS) 
 
@@ -69,13 +69,13 @@ endif
 
 
 AM_CFLAGS= -DIN_LINPHONE -I$(top_srcdir)/coreapi/ \
-               -I$(top_srcdir)/mediastreamer2/include/ \
+               $(MEDIASTREAMER_CFLAGS) \
                $(ORTP_CFLAGS) \
                $(STRICT_OPTIONS) $(LIBGTK_CFLAGS) $(IPV6_CFLAGS) \
                $(OSIP_CFLAGS) 
 
 
-version_date.h: $(top_srcdir)/configure.in
+version_date.h: $(top_srcdir)/configure.ac
        echo "#define LINPHONE_VERSION_DATE \"$(VERSION)-`date +%y%m%d`\"" > $@
 
 newdate:
index 0ea060241c1b0eba2f2233a8ea08536efd42df5f..83df3a44754075406dc1fae01f37c2db19b25a82 100644 (file)
@@ -142,13 +142,14 @@ void linphone_gtk_in_call_view_set_incoming(LinphoneCall *call, bool_t with_paus
        GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
        GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
        GtkWidget *callee=linphone_gtk_get_widget(callview,"in_call_uri");
-       GtkWidget *duration=linphone_gtk_get_widget(callview,"in_call_duration");
        GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
        GdkPixbufAnimation *pbuf=create_pixbuf_animation("calling_anim.gif");
        GtkWidget *answer_button;
 
        gtk_label_set_markup(GTK_LABEL(status),_("<b>Incoming call</b>"));
        gtk_widget_show_all(linphone_gtk_get_widget(callview,"answer_decline_panel"));
+       gtk_widget_hide(linphone_gtk_get_widget(callview,"duration_frame"));
+       gtk_widget_hide(linphone_gtk_get_widget(callview,"mute_pause_buttons"));
        display_peer_name_in_label(callee,linphone_call_get_remote_address (call));
 
        answer_button=linphone_gtk_get_widget(callview,"accept_call");
@@ -161,7 +162,6 @@ void linphone_gtk_in_call_view_set_incoming(LinphoneCall *call, bool_t with_paus
        gtk_button_set_image(GTK_BUTTON(linphone_gtk_get_widget(callview,"decline_call")),
                         create_pixmap (linphone_gtk_get_ui_config("stop_call_icon","stopcall-red.png")));
        
-       gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
        if (pbuf!=NULL){
                gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);
                g_object_unref(G_OBJECT(pbuf));
@@ -178,6 +178,8 @@ void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call){
        
        display_peer_name_in_label(callee,linphone_call_get_remote_address (call));
 
+       gtk_widget_show(linphone_gtk_get_widget(callview,"duration_frame"));
+       gtk_widget_show(linphone_gtk_get_widget(callview,"mute_pause_buttons"));
        gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
        gtk_label_set_markup(GTK_LABEL(status),_("<b>In call</b>"));
 
index 5cbf79fb5d73a68b4762860ec6566370c71165ff..637448818eaa2889061ac533a0a9e525f6b66ac5 100644 (file)
@@ -99,4 +99,5 @@ void linphone_gtk_enable_mute_button(GtkButton *button, gboolean sensitive);
 void linphone_gtk_enable_hold_button(LinphoneCall *call, gboolean sensitive, gboolean holdon);
 
 void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg);
-
+void linphone_gtk_exit_login_frame(void);
+void linphone_gtk_set_ui_config(const char *key, const char *value);
index 957b267267bfe88c388f1cbfa8af8ba29e41e6a8..f1a67d9d5826bd19e5fb0955097ea922e5a26569 100644 (file)
@@ -27,28 +27,28 @@ enum {
        NetworkKindOpticalFiber
 };
 
-static gboolean check_login_ok(LinphoneProxyConfig *cfg){
-       if (linphone_proxy_config_is_registered(cfg)){
-               linphone_gtk_exit_login_frame();
-               return FALSE;   
-       }
-       return TRUE;
-}
-
 static void do_login(SipSetupContext *ssctx, const char *identity, const char * passwd){
-       GtkWidget *mw=linphone_gtk_get_main_window();
        if (sip_setup_context_login_account(ssctx,identity,passwd)==0){
-               guint t=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(mw),"login_tout"));
-               if (t!=0) g_source_remove(t);
-               t=g_timeout_add(50,(GSourceFunc)check_login_ok,sip_setup_context_get_proxy_config(ssctx));
-               g_object_set_data(G_OBJECT(mw),"login_tout",GINT_TO_POINTER(t));
        }
 }
 
 static gboolean do_login_noprompt(LinphoneProxyConfig *cfg){
        SipSetupContext *ssctx=linphone_proxy_config_get_sip_setup_context(cfg);
+       LinphoneAddress *addr;
+       const char *username;
+       char *tmp;
        if (ssctx==NULL) return TRUE;/*not ready ?*/
-       do_login(ssctx,linphone_proxy_config_get_identity(cfg),NULL);
+       username=linphone_gtk_get_ui_config ("login_username",NULL);
+       if (username==NULL) {
+               linphone_gtk_set_ui_config_int("automatic_login",0);
+               linphone_gtk_show_login_frame(cfg);
+               return FALSE;
+       }
+       addr=linphone_address_new(linphone_proxy_config_get_identity(cfg));
+       linphone_address_set_username(addr,username);
+       tmp=linphone_address_as_string (addr);
+       do_login(ssctx,tmp,NULL);
+       linphone_address_destroy(addr);
        return FALSE;
 }
 
@@ -96,6 +96,11 @@ void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg){
        g_free(str);
 
        from=linphone_address_new(linphone_proxy_config_get_identity(cfg));
+       if (linphone_address_get_username(from)[0]=='?'){
+               const char *username=linphone_gtk_get_ui_config ("login_username",NULL);
+               if (username)
+                       linphone_address_set_username(from,username);
+       }
        
        ai=linphone_core_find_auth_info(lc,linphone_proxy_config_get_domain(cfg),linphone_address_get_username(from));
        /*display the last entered username, if not '?????'*/
@@ -152,6 +157,7 @@ void linphone_gtk_login_frame_connect_clicked(GtkWidget *button){
 
        autologin=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(mw,"automatic_login")));
        linphone_gtk_set_ui_config_int("automatic_login",autologin);
+       linphone_gtk_set_ui_config("login_username",username);
 
        from=linphone_address_new(linphone_proxy_config_get_identity(cfg));
        linphone_address_set_username(from,username);
index 452c7783fb68f13361d7746e08f70a0dd6cdbabc..ed2b77ba157cb33ba21a579d781cf9b0800b2379 100644 (file)
@@ -41,6 +41,7 @@ const char *this_program_ident_string="linphone_ident_string=" LINPHONE_VERSION;
 static LinphoneCore *the_core=NULL;
 static GtkWidget *the_ui=NULL;
 
+static void linphone_gtk_registration_state_changed(LinphoneCore *lc, LinphoneProxyConfig *cfg, LinphoneRegistrationState rs, const char *msg);
 static void linphone_gtk_show(LinphoneCore *lc);
 static void linphone_gtk_notify_recv(LinphoneCore *lc, LinphoneFriend * fid);
 static void linphone_gtk_new_unknown_subscriber(LinphoneCore *lc, LinphoneFriend *lf, const char *url);
@@ -94,7 +95,7 @@ static GOptionEntry linphone_options[]={
            .description = N_("if set automatically answer incoming calls")
        },
 #ifdef WIN32
-       {                               /* zsd addition */
+       {
            .long_name = "workdir",
            .short_name = '\0',
            .arg = G_OPTION_ARG_STRING,
@@ -193,6 +194,7 @@ static void linphone_gtk_init_liblinphone(const char *config_file,
        LinphoneCoreVTable vtable={0};
 
        vtable.call_state_changed=linphone_gtk_call_state_changed;
+       vtable.registration_state_changed=linphone_gtk_registration_state_changed;
        vtable.show=linphone_gtk_show;
        vtable.notify_presence_recv=linphone_gtk_notify_recv;
        vtable.new_unknown_subscriber=linphone_gtk_new_unknown_subscriber;
@@ -413,8 +415,10 @@ void linphone_gtk_show_about(){
        struct stat filestat;
        const char *license_file=PACKAGE_DATA_DIR "/linphone/COPYING";
        GtkWidget *about;
+       const char *tmp;
        GdkPixbuf *logo=create_pixbuf(
            linphone_gtk_get_ui_config("logo","linphone-banner.png"));
+       static const char *defcfg="defcfg";
        
        about=linphone_gtk_create_window("about");
        gtk_about_dialog_set_url_hook(about_url_clicked,NULL,NULL);
@@ -436,7 +440,19 @@ void linphone_gtk_show_about(){
        gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(about),linphone_gtk_get_ui_config("title","Linphone"));
        gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(about),linphone_gtk_get_ui_config("home","http://www.linphone.org"));
        if (logo)       gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(about),logo);
-           
+       tmp=linphone_gtk_get_ui_config("artists",defcfg);
+       if (tmp!=defcfg){
+               const char *tmp2[2];
+               tmp2[0]=tmp;
+               tmp2[1]=NULL;
+               gtk_about_dialog_set_artists(GTK_ABOUT_DIALOG(about),tmp2);
+       }
+       tmp=linphone_gtk_get_ui_config("translators",defcfg);
+       if (tmp!=defcfg)
+               gtk_about_dialog_set_translator_credits (GTK_ABOUT_DIALOG(about),tmp);
+       tmp=linphone_gtk_get_ui_config("comments",defcfg);
+       if (tmp!=defcfg)
+               gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about),tmp);
        gtk_widget_show(about);
 }
 
@@ -977,6 +993,23 @@ static void linphone_gtk_call_state_changed(LinphoneCore *lc, LinphoneCall *call
        linphone_gtk_update_call_buttons (call);
 }
 
+static void linphone_gtk_registration_state_changed(LinphoneCore *lc, LinphoneProxyConfig *cfg, 
+                                                    LinphoneRegistrationState rs, const char *msg){
+       switch (rs){
+               case LinphoneRegistrationOk:
+                       if (cfg){
+                               SipSetup *ss=linphone_proxy_config_get_sip_setup(cfg);
+                               if (ss && (sip_setup_get_capabilities(ss) & SIP_SETUP_CAP_LOGIN)){
+                                       linphone_gtk_exit_login_frame();
+                               }
+                       }
+               break;
+               default:
+               break;
+       }
+}
+
+
 static void icon_popup_menu(GtkStatusIcon *status_icon, guint button, guint activate_time, gpointer user_data){
        GtkWidget *menu=(GtkWidget*)g_object_get_data(G_OBJECT(status_icon),"menu");
        gtk_menu_popup(GTK_MENU(menu),NULL,NULL,gtk_status_icon_position_menu,status_icon,button,activate_time);
@@ -1138,6 +1171,7 @@ static void linphone_gtk_configure_main_window(){
        static const char *search_icon;
        static gboolean update_check_menu;
        static gboolean buttons_have_borders;
+       static gboolean show_abcd;
        GtkWidget *w=linphone_gtk_get_main_window();
        if (!config_loaded){
                title=linphone_gtk_get_ui_config("title","Linphone");
@@ -1148,6 +1182,7 @@ static void linphone_gtk_configure_main_window(){
                search_icon=linphone_gtk_get_ui_config("directory_search_icon",NULL);
                update_check_menu=linphone_gtk_get_ui_config_int("update_check_menu",0);
                buttons_have_borders=linphone_gtk_get_ui_config_int("buttons_border",1);
+               show_abcd=linphone_gtk_get_ui_config_int("show_abcd",1);
                config_loaded=TRUE;
        }
        linphone_gtk_configure_window(w,"main_window");
@@ -1205,6 +1240,13 @@ static void linphone_gtk_configure_main_window(){
        if (update_check_menu){
                gtk_widget_show(linphone_gtk_get_widget(w,"versioncheck_item"));
        }
+       if (!show_abcd){
+               gtk_widget_hide(linphone_gtk_get_widget(w,"dtmf_A"));
+               gtk_widget_hide(linphone_gtk_get_widget(w,"dtmf_B"));
+               gtk_widget_hide(linphone_gtk_get_widget(w,"dtmf_C"));
+               gtk_widget_hide(linphone_gtk_get_widget(w,"dtmf_D"));
+               gtk_table_resize(GTK_TABLE(linphone_gtk_get_widget(w,"dtmf_table")),4,3);
+       }
 }
 
 void linphone_gtk_manage_login(void){
@@ -1220,7 +1262,7 @@ void linphone_gtk_manage_login(void){
 }
 
 
-void linphone_gtk_close(GtkWidget *mw){
+gboolean linphone_gtk_close(GtkWidget *mw){
        /*shutdown calls if any*/
        LinphoneCore *lc=linphone_gtk_get_core();
        if (linphone_core_in_call(lc)){
@@ -1228,6 +1270,7 @@ void linphone_gtk_close(GtkWidget *mw){
        }
        linphone_core_enable_video_preview(lc,FALSE);
        gtk_widget_hide(mw);
+       return TRUE;
 }
 
 static void linphone_gtk_init_main_window(){
index e1ea351ea4c4adeb14452c5bb4891d1c5d9ae2aa..a2c717df58e86ad65c275902c278959a0c0672ba 100644 (file)
             <child>
               <object class="GtkMenuItem" id="menuitem4">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">Aid_e</property>
+                <property name="label" translatable="yes">_Help</property>
                 <property name="use_underline">True</property>
                 <child type="submenu">
                   <object class="GtkMenu" id="menu3">
                                                 <property name="position">2</property>
                                               </packing>
                                             </child>
+                                            <child>
+                                              <object class="GtkHButtonBox" id="hbuttonbox1">
+                                                <property name="visible">True</property>
+                                                <child>
+                                                  <object class="GtkButton" id="add_contact_button">
+                                                    <property name="label" translatable="yes">Add contact</property>
+                                                    <property name="can_focus">True</property>
+                                                    <property name="receives_default">True</property>
+                                                    <property name="image">image6</property>
+                                                    <signal name="clicked" handler="linphone_gtk_add_contact"/>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="fill">False</property>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                              </object>
+                                              <packing>
+                                                <property name="position">3</property>
+                                              </packing>
+                                            </child>
                                           </object>
                                         </child>
                                       </object>
             </child>
           </object>
           <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
             <property name="position">2</property>
           </packing>
         </child>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkFrame" id="frame1">
+                  <object class="GtkFrame" id="duration_frame">
                     <property name="visible">True</property>
                     <property name="label_xalign">0</property>
                     <child>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkHButtonBox" id="hbuttonbox4">
+                  <object class="GtkHButtonBox" id="mute_pause_buttons">
                     <property name="visible">True</property>
                     <property name="layout_style">spread</property>
                     <child>
       </object>
     </child>
   </object>
+  <object class="GtkImage" id="image6">
+    <property name="visible">True</property>
+    <property name="stock">gtk-add</property>
+  </object>
 </interface>
index 9d7f79e387996e7a94dc99c0d8bb59aa4d16758b..c594612cdbea0a5f4004d5797e77a4f7feb8269f 100644 (file)
@@ -1,55 +1,56 @@
 <?xml version="1.0"?>
 <interface>
+  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkAdjustment" id="adjustment1">
-    <property name="upper">3001</property>
+    <property name="value">500</property>
     <property name="lower">500</property>
-    <property name="page_increment">10</property>
+    <property name="upper">3001</property>
     <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
     <property name="page_size">10</property>
-    <property name="value">500</property>
   </object>
   <object class="GtkAdjustment" id="adjustment2">
-    <property name="upper">65535</property>
+    <property name="value">1</property>
     <property name="lower">1</property>
-    <property name="page_increment">10</property>
+    <property name="upper">65535</property>
     <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
     <property name="page_size">10</property>
-    <property name="value">1</property>
   </object>
   <object class="GtkAdjustment" id="adjustment3">
-    <property name="upper">65535</property>
+    <property name="value">1</property>
     <property name="lower">1</property>
-    <property name="page_increment">10</property>
+    <property name="upper">65535</property>
     <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
     <property name="page_size">10</property>
-    <property name="value">1</property>
   </object>
   <object class="GtkAdjustment" id="adjustment4">
-    <property name="upper">65535</property>
+    <property name="value">1</property>
     <property name="lower">1</property>
-    <property name="page_increment">10</property>
+    <property name="upper">65535</property>
     <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
     <property name="page_size">10</property>
-    <property name="value">1</property>
   </object>
   <object class="GtkAdjustment" id="adjustment5">
-    <property name="upper">100000</property>
     <property name="lower">-1</property>
-    <property name="page_increment">10</property>
+    <property name="upper">100000</property>
     <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
     <property name="page_size">10</property>
-    <property name="value">0</property>
   </object>
   <object class="GtkAdjustment" id="adjustment6">
-    <property name="upper">100000</property>
     <property name="lower">-1</property>
-    <property name="page_increment">10</property>
+    <property name="upper">100000</property>
     <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
     <property name="page_size">10</property>
-    <property name="value">0</property>
   </object>
   <object class="GtkListStore" id="model1">
     <columns>
+      <!-- column-name gchararray -->
       <column type="gchararray"/>
     </columns>
     <data>
@@ -60,6 +61,7 @@
   </object>
   <object class="GtkListStore" id="model2">
     <columns>
+      <!-- column-name gchararray -->
       <column type="gchararray"/>
     </columns>
     <data>
@@ -70,6 +72,7 @@
   </object>
   <object class="GtkListStore" id="model3">
     <columns>
+      <!-- column-name gchararray -->
       <column type="gchararray"/>
     </columns>
     <data>
@@ -80,6 +83,7 @@
   </object>
   <object class="GtkListStore" id="model4">
     <columns>
+      <!-- column-name gchararray -->
       <column type="gchararray"/>
     </columns>
     <data>
@@ -90,6 +94,7 @@
   </object>
   <object class="GtkListStore" id="model5">
     <columns>
+      <!-- column-name gchararray -->
       <column type="gchararray"/>
     </columns>
     <data>
   </object>
   <object class="GtkListStore" id="model6">
     <columns>
+      <!-- column-name gchararray -->
       <column type="gchararray"/>
     </columns>
     <data>
   </object>
   <object class="GtkListStore" id="model7">
     <columns>
+      <!-- column-name gchararray -->
       <column type="gchararray"/>
     </columns>
     <data>
       </row>
     </data>
   </object>
-  <!-- interface-requires gtk+ 2.16 -->
-  <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkWindow" id="parameters">
     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
     <property name="title" translatable="yes">Settings</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
                                     <property name="draw_indicator">True</property>
-                                    <signal handler="linphone_gtk_mtu_set" name="toggled"/>
+                                    <signal name="toggled" handler="linphone_gtk_mtu_set"/>
                                   </object>
                                   <packing>
                                     <property name="position">0</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="adjustment">adjustment1</property>
-                                    <signal handler="linphone_gtk_mtu_changed" name="value_changed"/>
+                                    <signal name="value_changed" handler="linphone_gtk_mtu_changed"/>
                                   </object>
                                   <packing>
                                     <property name="position">1</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
                                 <property name="draw_indicator">True</property>
-                                <signal handler="linphone_gtk_use_sip_info_dtmf_toggled" name="toggled"/>
+                                <signal name="toggled" handler="linphone_gtk_use_sip_info_dtmf_toggled"/>
                               </object>
                               <packing>
                                 <property name="position">1</property>
                                 <property name="receives_default">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="draw_indicator">True</property>
-                                <signal handler="linphone_gtk_ipv6_toggled" name="toggled"/>
+                                <signal name="toggled" handler="linphone_gtk_ipv6_toggled"/>
                               </object>
                               <packing>
                                 <property name="position">2</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="adjustment">adjustment2</property>
-                                <signal handler="linphone_gtk_video_port_changed" name="value_changed"/>
+                                <signal name="value_changed" handler="linphone_gtk_video_port_changed"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="adjustment">adjustment3</property>
-                                <signal handler="linphone_gtk_audio_port_changed" name="value_changed"/>
+                                <signal name="value_changed" handler="linphone_gtk_audio_port_changed"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="adjustment">adjustment4</property>
-                                <signal handler="linphone_gtk_sip_port_changed" name="value_changed"/>
+                                <signal name="value_changed" handler="linphone_gtk_sip_port_changed"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                             <property name="receives_default">False</property>
                             <property name="active">True</property>
                             <property name="draw_indicator">True</property>
-                            <signal handler="linphone_gtk_no_firewall_toggled" name="toggled"/>
+                            <signal name="toggled" handler="linphone_gtk_no_firewall_toggled"/>
                           </object>
                           <packing>
                             <property name="expand">False</property>
                                 <property name="active">True</property>
                                 <property name="draw_indicator">True</property>
                                 <property name="group">no_nat</property>
-                                <signal handler="linphone_gtk_use_nat_address_toggled" name="toggled"/>
+                                <signal name="toggled" handler="linphone_gtk_use_nat_address_toggled"/>
                               </object>
                               <packing>
                                 <property name="position">0</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <signal handler="linphone_gtk_nat_address_changed" name="changed"/>
+                                    <signal name="changed" handler="linphone_gtk_nat_address_changed"/>
                                   </object>
                                   <packing>
                                     <property name="position">1</property>
                                 <property name="active">True</property>
                                 <property name="draw_indicator">True</property>
                                 <property name="group">no_nat</property>
-                                <signal handler="linphone_gtk_use_stun_toggled" name="toggled"/>
+                                <signal name="toggled" handler="linphone_gtk_use_stun_toggled"/>
                               </object>
                               <packing>
                                 <property name="position">0</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <signal handler="linphone_gtk_stun_server_changed" name="changed"/>
+                                    <signal name="changed" handler="linphone_gtk_stun_server_changed"/>
                                   </object>
                                   <packing>
                                     <property name="position">1</property>
                                   <object class="GtkFileChooserButton" id="ring_chooser">
                                     <property name="visible">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <signal handler="linphone_gtk_ring_file_set" name="file_set"/>
+                                    <signal name="file_set" handler="linphone_gtk_ring_file_set"/>
                                   </object>
                                   <packing>
                                     <property name="position">0</property>
                                     <property name="receives_default">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                     <property name="use_stock">True</property>
-                                    <signal handler="linphone_gtk_play_ring_file" name="clicked"/>
+                                    <signal name="clicked" handler="linphone_gtk_play_ring_file"/>
                                   </object>
                                   <packing>
                                     <property name="position">1</property>
                               <object class="GtkEntry" id="alsa_dev">
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <signal handler="linphone_gtk_alsa_special_device_changed" name="editing_done"/>
+                                <signal name="editing_done" handler="linphone_gtk_alsa_special_device_changed"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                               <object class="GtkComboBox" id="capture_device">
                                 <property name="visible">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <signal handler="linphone_gtk_capture_device_changed" name="changed"/>
                                 <property name="model">model1</property>
+                                <signal name="changed" handler="linphone_gtk_capture_device_changed"/>
                                 <child>
                                   <object class="GtkCellRendererText" id="renderer1"/>
                                   <attributes>
                               <object class="GtkComboBox" id="ring_device">
                                 <property name="visible">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <signal handler="linphone_gtk_ring_device_changed" name="changed"/>
                                 <property name="model">model2</property>
+                                <signal name="changed" handler="linphone_gtk_ring_device_changed"/>
                                 <child>
                                   <object class="GtkCellRendererText" id="renderer2"/>
                                   <attributes>
                               <object class="GtkComboBox" id="playback_device">
                                 <property name="visible">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <signal handler="linphone_gtk_playback_device_changed" name="changed"/>
                                 <property name="model">model3</property>
+                                <signal name="changed" handler="linphone_gtk_playback_device_changed"/>
                                 <child>
                                   <object class="GtkCellRendererText" id="renderer3"/>
                                   <attributes>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
                                 <property name="draw_indicator">True</property>
-                                <signal handler="linphone_gtk_echo_cancelation_toggled" name="toggled"/>
+                                <signal name="toggled" handler="linphone_gtk_echo_cancelation_toggled"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkFrame" id="frame4">
+                  <object class="GtkFrame" id="video_frame">
                     <property name="visible">True</property>
                     <property name="label_xalign">0</property>
                     <child>
                             <child>
                               <object class="GtkComboBox" id="webcams">
                                 <property name="visible">True</property>
-                                <signal handler="linphone_gtk_cam_changed" name="changed"/>
                                 <property name="model">model4</property>
+                                <signal name="changed" handler="linphone_gtk_cam_changed"/>
                                 <child>
                                   <object class="GtkCellRendererText" id="renderer4"/>
                                   <attributes>
                             <child>
                               <object class="GtkComboBox" id="video_size">
                                 <property name="visible">True</property>
-                                <property name="active">0</property>
-                                <signal handler="linphone_gtk_video_size_changed" name="changed"/>
                                 <property name="model">model5</property>
+                                <property name="active">0</property>
+                                <signal name="changed" handler="linphone_gtk_video_size_changed"/>
                                 <child>
                                   <object class="GtkCellRendererText" id="renderer5"/>
                                   <attributes>
                       </object>
                     </child>
                     <child type="label">
-                      <object class="GtkLabel" id="video_frame">
+                      <object class="GtkLabel" id="video_frame_title">
                         <property name="visible">True</property>
                         <property name="label" translatable="yes">&lt;b&gt;Video&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
                   </packing>
                 </child>
               </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
             </child>
             <child type="tab">
               <object class="GtkHBox" id="hbox11">
                   <object class="GtkFrame" id="frame11">
                     <property name="visible">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="tooltip-text" translatable="yes">This section defines your SIP address when not using a SIP account</property>
+                    <property name="tooltip_text" translatable="yes">This section defines your SIP address when not using a SIP account</property>
                     <property name="label_xalign">0</property>
                     <child>
                       <object class="GtkAlignment" id="alignment11">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <signal handler="linphone_gtk_update_my_contact" name="changed"/>
+                                <signal name="changed" handler="linphone_gtk_update_my_contact"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <signal handler="linphone_gtk_update_my_contact" name="changed"/>
+                                <signal name="changed" handler="linphone_gtk_update_my_contact"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <signal handler="linphone_gtk_add_proxy" name="clicked"/>
+                                    <signal name="clicked" handler="linphone_gtk_add_proxy"/>
                                     <child>
                                       <object class="GtkHBox" id="hbox14">
                                         <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <signal handler="linphone_gtk_edit_proxy" name="clicked"/>
+                                    <signal name="clicked" handler="linphone_gtk_edit_proxy"/>
                                     <child>
                                       <object class="GtkHBox" id="hbox16">
                                         <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <signal handler="linphone_gtk_remove_proxy" name="clicked"/>
+                                    <signal name="clicked" handler="linphone_gtk_remove_proxy"/>
                                     <child>
                                       <object class="GtkHBox" id="hbox7">
                                         <property name="visible">True</property>
                                   <object class="GtkButton" id="create_phonics">
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
-                                    <signal handler="linphone_gtk_create_fonics_account" name="clicked"/>
+                                    <signal name="clicked" handler="linphone_gtk_create_fonics_account"/>
                                     <child>
                                       <object class="GtkHBox" id="hbox1">
                                         <property name="visible">True</property>
@@ -1227,7 +1235,7 @@ virtual network !</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <signal handler="linphone_gtk_clear_passwords" name="clicked"/>
+                                <signal name="clicked" handler="linphone_gtk_clear_passwords"/>
                                 <child>
                                   <object class="GtkHBox" id="hbox18">
                                     <property name="visible">True</property>
@@ -1279,6 +1287,9 @@ virtual network !</property>
                   </packing>
                 </child>
               </object>
+              <packing>
+                <property name="position">2</property>
+              </packing>
             </child>
             <child type="tab">
               <object class="GtkHBox" id="hbox10">
@@ -1334,9 +1345,9 @@ virtual network !</property>
                               <object class="GtkComboBox" id="codec_view">
                                 <property name="visible">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="active">0</property>
-                                <signal handler="linphone_gtk_codec_view_changed" name="changed"/>
                                 <property name="model">model6</property>
+                                <property name="active">0</property>
+                                <signal name="changed" handler="linphone_gtk_codec_view_changed"/>
                                 <child>
                                   <object class="GtkCellRendererText" id="renderer6"/>
                                   <attributes>
@@ -1387,7 +1398,7 @@ virtual network !</property>
                                         <property name="receives_default">True</property>
                                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                         <property name="use_stock">True</property>
-                                        <signal handler="linphone_gtk_codec_up" name="clicked"/>
+                                        <signal name="clicked" handler="linphone_gtk_codec_up"/>
                                       </object>
                                       <packing>
                                         <property name="expand">False</property>
@@ -1403,7 +1414,7 @@ virtual network !</property>
                                         <property name="receives_default">True</property>
                                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                         <property name="use_stock">True</property>
-                                        <signal handler="linphone_gtk_codec_down" name="clicked"/>
+                                        <signal name="clicked" handler="linphone_gtk_codec_down"/>
                                       </object>
                                       <packing>
                                         <property name="expand">False</property>
@@ -1417,7 +1428,7 @@ virtual network !</property>
                                         <property name="can_focus">True</property>
                                         <property name="receives_default">True</property>
                                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                        <signal handler="linphone_gtk_codec_enable" name="clicked"/>
+                                        <signal name="clicked" handler="linphone_gtk_codec_enable"/>
                                         <child>
                                           <object class="GtkHBox" id="hbox8">
                                             <property name="visible">True</property>
@@ -1457,7 +1468,7 @@ virtual network !</property>
                                         <property name="can_focus">True</property>
                                         <property name="receives_default">True</property>
                                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                        <signal handler="linphone_gtk_codec_disable" name="clicked"/>
+                                        <signal name="clicked" handler="linphone_gtk_codec_disable"/>
                                         <child>
                                           <object class="GtkHBox" id="hbox9">
                                             <property name="visible">True</property>
@@ -1540,9 +1551,9 @@ virtual network !</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="tooltip-text" translatable="yes">0 stands for "unlimited"</property>
+                                <property name="tooltip_text" translatable="yes">0 stands for "unlimited"</property>
                                 <property name="adjustment">adjustment5</property>
-                                <signal handler="linphone_gtk_upload_bw_changed" name="value_changed"/>
+                                <signal name="value_changed" handler="linphone_gtk_upload_bw_changed"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
@@ -1556,9 +1567,9 @@ virtual network !</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="tooltip-text" translatable="yes">0 stands for "unlimited"</property>
+                                <property name="tooltip_text" translatable="yes">0 stands for "unlimited"</property>
                                 <property name="adjustment">adjustment6</property>
-                                <signal handler="linphone_gtk_download_bw_changed" name="value_changed"/>
+                                <signal name="value_changed" handler="linphone_gtk_download_bw_changed"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
@@ -1603,6 +1614,9 @@ virtual network !</property>
                   </packing>
                 </child>
               </object>
+              <packing>
+                <property name="position">3</property>
+              </packing>
             </child>
             <child type="tab">
               <object class="GtkHBox" id="hbox15">
@@ -1649,8 +1663,8 @@ virtual network !</property>
                         <child>
                           <object class="GtkComboBox" id="lang_combo">
                             <property name="visible">True</property>
-                            <signal handler="linphone_gtk_lang_changed" name="changed"/>
                             <property name="model">model7</property>
+                            <signal name="changed" handler="linphone_gtk_lang_changed"/>
                             <child>
                               <object class="GtkCellRendererText" id="renderer7"/>
                               <attributes>
@@ -1689,7 +1703,7 @@ virtual network !</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
                             <property name="draw_indicator">True</property>
-                            <signal handler="linphone_gtk_ui_level_toggled" name="toggled"/>
+                            <signal name="toggled" handler="linphone_gtk_ui_level_toggled"/>
                           </object>
                         </child>
                       </object>
@@ -1708,6 +1722,9 @@ virtual network !</property>
                   </packing>
                 </child>
               </object>
+              <packing>
+                <property name="position">4</property>
+              </packing>
             </child>
             <child type="tab">
               <object class="GtkHBox" id="hbox4">
@@ -1753,7 +1770,7 @@ virtual network !</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <signal handler="linphone_gtk_parameters_closed" name="clicked"/>
+                <signal name="clicked" handler="linphone_gtk_parameters_closed"/>
                 <child>
                   <object class="GtkHBox" id="hbox3">
                     <property name="visible">True</property>
index 2124d2ee8deda69c1b565aae1d146fe8659845f6..227d5b42cfcbd8ca238ebfcd2e3ae08025febe7f 100644 (file)
@@ -192,6 +192,10 @@ void linphone_gtk_set_ui_config_int(const char *key , int val){
        lp_config_set_int(cfg,"GtkUi",key,val);
 }
 
+void linphone_gtk_set_ui_config(const char *key , const char * val){
+       LpConfig *cfg=linphone_core_get_config(linphone_gtk_get_core());
+       lp_config_set_string(cfg,"GtkUi",key,val);
+}
 
 static void parse_item(const char *item, const char *window_name, GtkWidget *w,  gboolean show){
        char tmp[64];
index f2ddc59ed02f26ff828243fa400abae925b6f730..9492b114126f17d06ca365757ada450ad72d5eb5 160000 (submodule)
@@ -1 +1 @@
-Subproject commit f2ddc59ed02f26ff828243fa400abae925b6f730
+Subproject commit 9492b114126f17d06ca365757ada450ad72d5eb5
index b462cf8e74116214e7b0165eb85e6aef9050f2a8..087e6fcd41cfcd53194f86f3acf670cbca56cbc4 100644 (file)
@@ -12,6 +12,6 @@ status-orange.png \
 status-red.png \
 status-offline.png \
 contact-orange.png dialer-orange.png history-orange.png\
-startcall-green.png stopcall-red.png 
+startcall-green.png stopcall-red.png addcall-green.png
 
 EXTRA_DIST=$(pixmap_DATA)
index 57f26a8a19cc81ed18333726ec1a209adf29f1ef..6def02724e4903ed74404323f3af58977c4992d5 100644 (file)
@@ -5,6 +5,7 @@ LINPHONE_SOUNDS=ringback.wav hello8000.wav hello16000.wav
 LINPHONE_RINGS=rings/orig.wav \
                                rings/oldphone.wav \
                                rings/oldphone-mono.wav \
+                               rings/oldphone-mono-30s.caf \
                                rings/rock.wav \
                                rings/bigben.wav \
                                rings/toy.wav \
diff --git a/share/rings/oldphone-mono-30s.caf b/share/rings/oldphone-mono-30s.caf
new file mode 100644 (file)
index 0000000..1485929
Binary files /dev/null and b/share/rings/oldphone-mono-30s.caf differ